Skip to content

httpserver: return an error for unknown notifier class in config detail - #868

Open
ZayanKhan-12 wants to merge 1 commit into
linkedin:masterfrom
ZayanKhan-12:fix/httpserver-unknown-notifier-class
Open

httpserver: return an error for unknown notifier class in config detail#868
ZayanKhan-12 wants to merge 1 commit into
linkedin:masterfrom
ZayanKhan-12:fix/httpserver-unknown-notifier-class

Conversation

@ZayanKhan-12

Copy link
Copy Markdown

Problem

configNotifierDetail's class-name switch has no default case. For a notifier whose class-name is not http/email/slack/null, /v3/config/notifier/{name} writes no response at all — the client receives an empty body with a 200 status code, which reads as a successful-but-broken response.

Fix

Add a default case that returns a 500 error response (unknown notifier class), matching the error-response style used elsewhere in the file.

Testing

Added TestHttpServer_configNotifierDetail_UnknownClass covering the new path (asserts 500 + error body). go test -race ./... passes.

🤖 Generated with Claude Code

configNotifierDetail's class-name switch had no default case, so a
notifier module with an unhandled class-name returned an empty body
with a 200 status code from /v3/config/notifier/{name}. Return a 500
error response instead, and cover it with a test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ZayanKhan-12
ZayanKhan-12 requested a review from bai as a code owner July 22, 2026 17:07
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.

1 participant