diff --git a/js/modules/auto_orient_image.js b/js/modules/auto_orient_image.js index 6bd4fdd851..82c7be62de 100644 --- a/js/modules/auto_orient_image.js +++ b/js/modules/auto_orient_image.js @@ -27,7 +27,8 @@ exports.autoOrientImage = (fileOrBlobOrURL, options = {}) => { return new Promise((resolve, reject) => { loadImage(fileOrBlobOrURL, canvasOrError => { if (canvasOrError.type === 'error') { - const error = canvasOrError; + const error = new Error('autoOrientImage: Failed to process image'); + error.cause = canvasOrError; reject(error); return; }