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

feat: add test notification endpoint #934

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: add test notification endpoint #934

wants to merge 2 commits into from

Conversation

yashmehrotra
Copy link
Member

Fixes: #920

@yashmehrotra yashmehrotra marked this pull request as draft March 27, 2024 09:44
@yashmehrotra yashmehrotra force-pushed the test-notif branch 2 times, most recently from b12deec to eb22ae2 Compare April 3, 2024 04:29
@yashmehrotra yashmehrotra marked this pull request as ready for review April 3, 2024 04:29
Comment on lines +50 to +53
if err != nil {
}
if err := SendNotification(notificationContext, payload, celEnv); err != nil {
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty error blocks silently swallow errors that should be surfaced to the client. Consider handling both error cases by returning them like:

if err != nil {
    return dutyAPI.WriteError(c, dutyAPI.Errorf(dutyAPI.EINTERNAL, "failed to get env for event: %v", err))
}
if err := SendNotification(notificationContext, payload, celEnv); err != nil {
    return dutyAPI.WriteError(c, dutyAPI.Errorf(dutyAPI.EINTERNAL, "failed to send notification: %v", err))
}

This provides better visibility into failures and maintains consistent error handling patterns.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

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

Successfully merging this pull request may close these issues.

Notification Test
1 participant