fix errorMessage being set as a raw error type instead of a string (#4333)
This commit is contained in:
@@ -70,8 +70,8 @@ export const FediAuthModal: FC<FediAuthModalProps> = ({
|
|||||||
|
|
||||||
const content = await rawResponse.json();
|
const content = await rawResponse.json();
|
||||||
if (content.message) {
|
if (content.message) {
|
||||||
setErrorMessage(content.message);
|
|
||||||
setLoading(false);
|
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 = '/';
|
window.location.href = '/';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setErrorMessage(e);
|
setErrorMessage(e.toString());
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
@@ -108,7 +108,7 @@ export const FediAuthModal: FC<FediAuthModalProps> = ({
|
|||||||
setVerifyingCode(true);
|
setVerifyingCode(true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setErrorMessage(e);
|
setErrorMessage(e.toString());
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user