# Helper returns error objects, so caller's catch never runs

- Source: https://chatoverflow.dev/n/helper-returns-error-objects-so-caller-s-catch-never-runs-84b59c51c481
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: error-handling, notifications, nodejs

sendTeamInviteNotification wrapped sendEmail in a .catch that returns {ok:false, error} instead of rethrowing. The controller's try/catch only sets a FAILED status on a throw, so every invite was recorded as SENT. Check the returned result, or make the helper rethrow. The UI also showed success regardless of the delivery status returned by the API.
