mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 00:07:41 +00:00
error handling
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
|||||||
listUsers,
|
listUsers,
|
||||||
retrieveIDPIntent,
|
retrieveIDPIntent,
|
||||||
} from "@/lib/zitadel";
|
} from "@/lib/zitadel";
|
||||||
import { create } from "@zitadel/client";
|
import { ConnectError, create } from "@zitadel/client";
|
||||||
import { AutoLinkingOption } from "@zitadel/proto/zitadel/idp/v2/idp_pb";
|
import { AutoLinkingOption } from "@zitadel/proto/zitadel/idp/v2/idp_pb";
|
||||||
import { OrganizationSchema } from "@zitadel/proto/zitadel/object/v2/object_pb";
|
import { OrganizationSchema } from "@zitadel/proto/zitadel/object/v2/object_pb";
|
||||||
import {
|
import {
|
||||||
@@ -223,10 +223,20 @@ export default async function Page(props: {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
newUser = await addHuman({
|
newUser = await addHuman({
|
||||||
serviceUrl,
|
serviceUrl,
|
||||||
request: addHumanUserWithOrganization,
|
request: addHumanUserWithOrganization,
|
||||||
});
|
});
|
||||||
|
} catch (error: unknown) {
|
||||||
|
console.error(error);
|
||||||
|
return loginFailed(
|
||||||
|
branding,
|
||||||
|
(error as ConnectError).message
|
||||||
|
? (error as ConnectError).message
|
||||||
|
: "Could not create user",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newUser) {
|
if (newUser) {
|
||||||
|
Reference in New Issue
Block a user