FIX: Pass fileName to error handler for media optimization (#14058)

FIX: Pass fileName to error handler for media optimization (#14058)

The file name is used to look up the promise to resolve; it was being passed for the successful path but not for the error path.

diff --git a/public/javascripts/media-optimization-worker.js b/public/javascripts/media-optimization-worker.js
index 0f25f74..3ed3c52 100644
--- a/public/javascripts/media-optimization-worker.js
+++ b/public/javascripts/media-optimization-worker.js
@@ -139,7 +139,8 @@ onmessage = async function (e) {
         console.error(error);
         postMessage({
           type: "error",
-          file: e.data.file
+          file: e.data.file,
+          fileName: e.data.fileName
         });
       }
       break;
@@ -172,4 +173,4 @@ async function loadLibs(settings){
   await wasm_bindgen(settings.resize_wasm);
 
   self.codecs = {mozjpeg_enc: mozjpeg_enc_module, resize: resize};
-}
\ No newline at end of file
+}

GitHub sha: 90ab520d0602f781fbbc0875552444ea78865bc4

This commit appears in #14058 which was approved by lis2. It was merged by martin.