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

showAlertForError: fallthrough when response.error() fails

See merge request soapbox-pub/soapbox!3306
merge-requests/3307/merge
Alex Gleason 2024-12-26 17:29:28 +00:00
commit baf1c2acae
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

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