mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 01:16:55 -05:00
fix: rethrow error from db hooks if it is APIError instances
This commit is contained in:
@@ -199,6 +199,9 @@ export const signUpEmail = <O extends BetterAuthOptions>() =>
|
||||
if (isDevelopment) {
|
||||
ctx.context.logger.error("Failed to create user", e);
|
||||
}
|
||||
if (e instanceof APIError) {
|
||||
throw e;
|
||||
}
|
||||
throw new APIError("UNPROCESSABLE_ENTITY", {
|
||||
message: BASE_ERROR_CODES.FAILED_TO_CREATE_USER,
|
||||
details: e,
|
||||
|
||||
Reference in New Issue
Block a user