Improve error display for server check verification
cgen-2ceb114a136b4d41b1900a394634f933
This commit is contained in:
parent
c785b2379c
commit
020669bb9c
1 changed files with 3 additions and 1 deletions
|
|
@ -209,10 +209,12 @@ export default function Welcome({
|
||||||
|
|
||||||
const payload = await resp.json().catch(() => ({} as any));
|
const payload = await resp.json().catch(() => ({} as any));
|
||||||
if (!resp.ok) {
|
if (!resp.ok) {
|
||||||
|
const serverMessage =
|
||||||
|
payload?.error || payload?.message || (Object.keys(payload || {}).length ? JSON.stringify(payload) : "Server check failed");
|
||||||
console.error("Server check-verification failed", payload);
|
console.error("Server check-verification failed", payload);
|
||||||
toastError({
|
toastError({
|
||||||
title: "Unable to verify",
|
title: "Unable to verify",
|
||||||
description: payload?.error || "Server check failed",
|
description: serverMessage,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const confirmed = Boolean(payload?.verified);
|
const confirmed = Boolean(payload?.verified);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue