From 3158e0a16abc898c7229d899b87860b54f21dfdd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 26 Dec 2024 11:26:58 -0600 Subject: [PATCH] showAlertForError: fallthrough when response.error() fails --- src/toast.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/toast.tsx b/src/toast.tsx index 3011a9b87..ee2e4d6ae 100644 --- a/src/toast.tsx +++ b/src/toast.tsx @@ -57,9 +57,13 @@ async function showAlertForError(networkError: HTTPError): Promise { 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;