Skip to content

Commit

Permalink
typecheck for #59
Browse files Browse the repository at this point in the history
  • Loading branch information
gregv committed Dec 3, 2023
1 parent 61bc2fa commit 53793aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/routes/_auth+/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export async function action({ request }: DataFunctionArgs) {
if (response.status === 'success') {
return redirect(redirectTo.pathname + redirectTo.search)
} else {
submission.error[''] = response.error.message
submission.error[''] = 'There was an error sending the email.' + response.error;
if ( response.error?.message ){
submission.error[''] += ' ' + response.error.message;
}

return json(
{
status: 'error',
Expand Down
9 changes: 7 additions & 2 deletions app/utils/email.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ export async function sendEmail({
data: response,
} as const

} catch (e) {
// Catch full exception
} catch (e : any) {
console.error('🔴 error sending email:', JSON.stringify(email))
return {
status: 'error',
error: e
error: {
message: e.message || 'Unknown error',
code: e.code || 'Unknown code',
response: e.response || 'Unknown response',
}
}
}
}
Expand Down

0 comments on commit 53793aa

Please sign in to comment.