Remove try-catch to display proper api-errors (#5570)

This commit is contained in:
Daniel James Smith 2023-06-14 11:28:32 +02:00 committed by GitHub
parent 72a5ba455c
commit 3b708d9311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -35,13 +35,9 @@ export class SimpleLoginForwarder implements Forwarder {
if (response.status === 401) {
throw "Invalid SimpleLogin API key.";
}
try {
const json = await response.json();
if (json?.error != null) {
throw "SimpleLogin error:" + json.error;
}
} catch {
// Do nothing...
const json = await response.json();
if (json?.error != null) {
throw "SimpleLogin error:" + json.error;
}
throw "Unknown SimpleLogin error occurred.";
}