From 73568ba55a3671e00dec126bf01d424a4661f950 Mon Sep 17 00:00:00 2001 From: Katharina Irrgang Date: Wed, 4 Oct 2017 11:03:26 +0200 Subject: [PATCH] Image Size Utility: optimised unknown request error handling (#9094) no issue - we want to know and learn from the full original error --- core/server/utils/image-size.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/server/utils/image-size.js b/core/server/utils/image-size.js index 48839e328c..083465e5ac 100644 --- a/core/server/utils/image-size.js +++ b/core/server/utils/image-size.js @@ -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 })); }); };