Skip to content

Commit

Permalink
Image Size Utility: optimised unknown request error handling (#9094)
Browse files Browse the repository at this point in the history
no issue

- we want to know and learn from the full original error
  • Loading branch information
kirrg001 authored and kevinansfield committed Oct 4, 2017
1 parent 3d6227e commit 73568ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/server/utils/image-size.js
Expand Up @@ -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
}));
});
};
Expand Down

0 comments on commit 73568ba

Please sign in to comment.