mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 00:15:11 +03:00
Improved error logging for member CSV import
no issue - Error object can be an array in case of database constrain validation errors, for this reason need to distinguish between singular objects and an array. This handling resemles the one in common error-handler - https://github.com/TryGhost/Ghost/blob/3.5.0/core/server/web/shared/middlewares/error-handler.js#L31-L33
This commit is contained in:
parent
019605e9e0
commit
42f4518a63
@ -342,7 +342,12 @@ const members = {
|
||||
} else {
|
||||
// NOTE: if the error happens as a result of pure API call it doesn't get logged anywhere
|
||||
// for this reason we have to make sure any unexpected errors are logged here
|
||||
common.logging.error(inspection.reason());
|
||||
if (Array.isArray(inspection.reason())) {
|
||||
common.logging.error(inspection.reason()[0]);
|
||||
} else {
|
||||
common.logging.error(inspection.reason());
|
||||
}
|
||||
|
||||
invalid = invalid + 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user