Merge branch 'toast-error-fallthrough' into 'main'

showAlertForError: fallthrough when response.error() fails

See merge request soapbox-pub/soapbox!3306
This commit is contained in:
Alex Gleason 2024-12-26 17:29:28 +00:00
commit baf1c2acae
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;