showAlertForError: fallthrough when response.error() fails

This commit is contained in:
Alex Gleason 2024-12-26 11:26:58 -06:00
parent c737d7cb5c
commit 3158e0a16a
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 7 additions and 3 deletions

View File

@ -57,10 +57,14 @@ async function showAlertForError(networkError: HTTPError): Promise<void> {
return;
}
try {
const data = await response.error();
if (data) {
return error(data.error);
}
} catch {
// fallthrough
}
const message = httpErrorMessages.find((httpError) => httpError.code === status)?.description;