api: update error codes in services, add more error codes where needed

This commit is contained in:
wukko
2024-08-20 21:10:37 +06:00
parent c698d272a1
commit 05abf9ad3e
21 changed files with 263 additions and 141 deletions

View File

@@ -241,14 +241,14 @@ export default async function(host, patternMatch, obj) {
if (r.error && r.critical) {
return createResponse("critical", {
code: r.error
code: `error.api.${r.error}`,
})
}
if (r.error) {
return createResponse("error", {
code: r.error,
context: response?.context
code: `error.api.${r.error}`,
context: r?.context
})
}