kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'toast-error-fallthrough' into 'main'
showAlertForError: fallthrough when response.error() fails See merge request soapbox-pub/soapbox!3306merge-requests/3307/merge
commit
baf1c2acae
|
@ -57,9 +57,13 @@ async function showAlertForError(networkError: HTTPError): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
const data = await response.error();
|
||||
if (data) {
|
||||
return error(data.error);
|
||||
try {
|
||||
const data = await response.error();
|
||||
if (data) {
|
||||
return error(data.error);
|
||||
}
|
||||
} catch {
|
||||
// fallthrough
|
||||
}
|
||||
|
||||
const message = httpErrorMessages.find((httpError) => httpError.code === status)?.description;
|
||||
|
|
Ładowanie…
Reference in New Issue