Skip to content

best way to save what you love

api/processing/request: return a unique error code

wukkod18b22e7ed2c
diff --git a/api/src/processing/request.js b/api/src/processing/request.js
index 61f801e0..95c83659 100644
--- a/api/src/processing/request.js
+++ b/api/src/processing/request.js
@@ -11,7 +11,7 @@ export function createResponse(responseType, responseData) {
body: {
status: "error",
error: {
- code: code || "error.api.fetch.critical",
+ code: code || "error.api.fetch.critical.core",
},
critical: true
}
@@ -109,7 +109,7 @@ export function createResponse(responseType, responseData) {
}
}
} catch {
- return internalError()
+ return internalError();
}
}
diff --git a/web/i18n/en/error/api.json b/web/i18n/en/error/api.json
index 797d920b..f0ece2d6 100644
--- a/web/i18n/en/error/api.json
+++ b/web/i18n/en/error/api.json
@@ -31,6 +31,7 @@
"fetch.fail": "something went wrong when fetching info from {{ service }} and i couldn't get anything for you. if this issue sticks, please report it!",
"fetch.critical": "the {{ service }} module returned an error that i don't recognize. try again in a few seconds, but if this issue sticks, please report it!",
+ "fetch.critical.core": "one of core modules returned an error that i don't recognize. try again in a few seconds, but if this issue sticks, please report it!",
"fetch.empty": "couldn't find any media that i could download for you. are you sure you pasted the right link?",
"fetch.rate": "the processing instance got rate limited by {{ service }}. try again in a few seconds!",
"fetch.short_link": "couldn't get info from the short link. are you sure it works? if it does and you still get this error, please report the issue!",