showAlertForError: fallthrough when response.error() fails
This commit is contained in:
parent
c737d7cb5c
commit
3158e0a16a
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue