fix errorMessage being set as a raw error type instead of a string (#4333)

This commit is contained in:
mahmed2000
2025-05-10 13:20:24 -07:00
committed by GitHub
parent b0d5f1ecfb
commit d1879e74b5
@@ -70,8 +70,8 @@ export const FediAuthModal: FC<FediAuthModalProps> = ({
const content = await rawResponse.json();
if (content.message) {
setErrorMessage(content.message);
setLoading(false);
throw new Error(content.message); // let the callers handle setting error message since they already are
}
};
@@ -87,7 +87,7 @@ export const FediAuthModal: FC<FediAuthModalProps> = ({
window.location.href = '/';
} catch (e) {
console.error(e);
setErrorMessage(e);
setErrorMessage(e.toString());
}
setLoading(false);
};
@@ -108,7 +108,7 @@ export const FediAuthModal: FC<FediAuthModalProps> = ({
setVerifyingCode(true);
} catch (e) {
console.error(e);
setErrorMessage(e);
setErrorMessage(e.toString());
}
setLoading(false);
};