mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 15:03:52 +00:00
try catch
This commit is contained in:
@@ -46,13 +46,18 @@ export default function UsernameForm({
|
|||||||
async function submitLoginName(values: Inputs, organization?: string) {
|
async function submitLoginName(values: Inputs, organization?: string) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
const res = await sendLoginname({
|
let res;
|
||||||
loginName: values.loginName,
|
try {
|
||||||
organization,
|
res = await sendLoginname({
|
||||||
authRequestId,
|
loginName: values.loginName,
|
||||||
}).catch((error: Error) => {
|
organization,
|
||||||
setError(error.message ?? "An internal error occurred");
|
authRequestId,
|
||||||
});
|
});
|
||||||
|
} catch (error: unknown) {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
setError(error.message ?? "An internal error occurred");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user