Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email sending errors are silently caught in sendEmailAndSaveMetadata #2386

Open
arsser opened this issue Nov 27, 2024 · 0 comments
Open

Email sending errors are silently caught in sendEmailAndSaveMetadata #2386

arsser opened this issue Nov 27, 2024 · 0 comments
Assignees

Comments

@arsser
Copy link

arsser commented Nov 27, 2024

Current Behavior

In sendEmailAndSaveMetadata, email sending errors are caught and only logged, but not propagated:

emailSender.send(content).catch((e) => {
console.error('Failed to send email', e);
});

This means:

  1. The function always appears to succeed even when email sending fails
  2. The error cannot be handled by the calling code
  3. Users don't receive proper error feedback in the UI

Expected Behavior

Email sending errors should be propagated so they can be:

  1. Properly handled by the calling code
  2. Converted to appropriate HTTP errors
  3. Displayed to users in the frontend

Proposed Solution

Change the code to: await emailSender.send(content); // Let errors propagate

This allows proper error handling in actions/APIs that use these email functions.

Impact

This change would improve:

  1. Error visibility and debugging
  2. User experience with proper error messages
  3. Ability to handle email sending failures appropriately

Additional Context

This issue was discovered when implementing email verification where users weren't seeing proper error messages when email sending failed.

@Martinsos Martinsos assigned Martinsos and infomiho and unassigned Martinsos Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants