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