Skip to content

feat: add test notification endpoint#934

Open
yashmehrotra wants to merge 2 commits intomainfrom
test-notif
Open

feat: add test notification endpoint#934
yashmehrotra wants to merge 2 commits intomainfrom
test-notif

Conversation

@yashmehrotra
Copy link
Copy Markdown
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
Copy Markdown

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