mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
feat: better error handling in forgotPassword trpc router
This commit is contained in:
committed by
Mythie
parent
9b025f0c9f
commit
1e0cde850a
@ -69,13 +69,16 @@ export const profileRouter = router({
|
||||
email,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
let message =
|
||||
'We were unable to update your profile. Please review the information you provided and try again.';
|
||||
|
||||
if (err instanceof Error) {
|
||||
message = err.message;
|
||||
}
|
||||
|
||||
// TODO: Handle this error better
|
||||
throw new TRPCError({
|
||||
code: 'BAD_REQUEST',
|
||||
message:
|
||||
'We were unable to update your profile. Please review the information you provided and try again.',
|
||||
message,
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user