summaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 20402539..197734b1 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -1936,11 +1936,16 @@ class Backend {
if (!isObject(error2.data)) { continue; }
const {details} = error2.data;
if (!isObject(details)) { continue; }
- if (details.error === 'net::ERR_FAILED') {
- // This is potentially an error due to the extension not having enough URL privileges.
- // The message logged to the console looks like this:
- // Access to fetch at '<URL>' from origin 'chrome-extension://<ID>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
- return this._createAudioDownloadError('Audio download failed due to possible extension permissions error', 'audio-download-failed', errors);
+ switch (details.error) {
+ case 'net::ERR_FAILED':
+ // This is potentially an error due to the extension not having enough URL privileges.
+ // The message logged to the console looks like this:
+ // Access to fetch at '<URL>' from origin 'chrome-extension://<ID>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
+ return this._createAudioDownloadError('Audio download failed due to possible extension permissions error', 'audio-download-failed-permissions-error', errors);
+ case 'net::ERR_CERT_DATE_INVALID': // Chrome
+ case 'Peer’s Certificate has expired.': // Firefox
+ // This error occurs when a server certificate expires.
+ return this._createAudioDownloadError('Audio download failed due to an expired server certificate', 'audio-download-failed-expired-server-certificate', errors);
}
}
}