Image Size Utility: optimised unknown request error handling (#9094)

no issue

- we want to know and learn from the full original error
This commit is contained in:
Katharina Irrgang 2017-10-04 11:03:26 +02:00 committed by Kevin Ansfield
parent 3d6227e11b
commit 73568ba55a

View File

@ -155,14 +155,16 @@ getImageSizeFromUrl = function getImageSizeFromUrl(imagePath) {
context: err.url || imagePath
}));
}).catch(function (err) {
if (err instanceof errors.GhostError) {
if (errors.utils.isIgnitionError(err)) {
return Promise.reject(err);
}
return Promise.reject(new errors.InternalServerError({
message: 'Unknown Request error.',
code: 'IMAGE_SIZE_URL',
statusCode: err.statusCode,
context: err.url || imagePath
context: err.url || imagePath,
err: err
}));
});
};