Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

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

mahmed20002d1bd1cc57da
diff --git a/web/components/modals/FediAuthModal/FediAuthModal.tsx b/web/components/modals/FediAuthModal/FediAuthModal.tsx
index 389f9b61ba..49929ae7bd 100644
--- a/web/components/modals/FediAuthModal/FediAuthModal.tsx
+++ b/web/components/modals/FediAuthModal/FediAuthModal.tsx
@@ -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);
};