diff --git a/src/core/toast.ts b/src/core/toast.ts index 8a71eb0..d6bba96 100644 --- a/src/core/toast.ts +++ b/src/core/toast.ts @@ -70,7 +70,10 @@ toast.promise = ( const id = toast.loading(msgs.loading, { ...opts, ...opts?.loading }); promise - .then((p) => { + .then(async (p) => { + if (p instanceof Response && !p?.ok) { + throw Error(await p.text()); + } toast.success(resolveValue(msgs.success, p), { id, ...opts,