mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +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,
|
email,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} 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({
|
throw new TRPCError({
|
||||||
code: 'BAD_REQUEST',
|
code: 'BAD_REQUEST',
|
||||||
message:
|
message,
|
||||||
'We were unable to update your profile. Please review the information you provided and try again.',
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user