notify: a failed Mattermost delivery's error names Mattermost #240

Merged
clawbot merged 1 commits from issue-227-mattermost-error-name into next 2026-10-02 08:40:20 +02:00
Collaborator

Closes #227

Mattermost notifications are sent by the Slack sender, which wrapped every HTTP error status in ErrSlackFailed. With DNSWATCHER_MATTERMOST_WEBHOOK answering 503, the warning said "endpoint":"mattermost" but "error":"slack notification failed: status 503".

The sender now takes the error to wrap: the Slack endpoint passes ErrSlackFailed and the Mattermost endpoint passes ErrMattermostFailed. A new test in internal/notify/delivery_test.go sets both endpoints to a stand-in server answering 503 and checks that the error logged after retries for each names its own endpoint.

The test-only SendSlack export takes the same new parameter, so the existing Slack sender tests now pass ErrSlackFailed themselves.

  • Scope: a delivery that gets no HTTP answer at all still reads sending webhook request: ... for both endpoints, as before; the endpoint field tells them apart, and the issue covers HTTP errors only.
  • Judgement call: the sender keeps its name sendSlack rather than being renamed, to keep the change small.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/dnswatcher/issues/227 Mattermost notifications are sent by the Slack sender, which wrapped every HTTP error status in `ErrSlackFailed`. With `DNSWATCHER_MATTERMOST_WEBHOOK` answering 503, the warning said `"endpoint":"mattermost"` but `"error":"slack notification failed: status 503"`. The sender now takes the error to wrap: the Slack endpoint passes `ErrSlackFailed` and the Mattermost endpoint passes `ErrMattermostFailed`. A new test in `internal/notify/delivery_test.go` sets both endpoints to a stand-in server answering 503 and checks that the error logged after retries for each names its own endpoint. The test-only `SendSlack` export takes the same new parameter, so the existing Slack sender tests now pass `ErrSlackFailed` themselves. - Scope: a delivery that gets no HTTP answer at all still reads `sending webhook request: ...` for both endpoints, as before; the `endpoint` field tells them apart, and the issue covers HTTP errors only. - Judgement call: the sender keeps its name `sendSlack` rather than being renamed, to keep the change small. Model: opus-5-5
clawbot added the needs-review label 2026-10-02 08:15:01 +02:00
clawbot self-assigned this 2026-10-02 08:15:01 +02:00
Author
Collaborator

Review passed on bdd6de3.

Model: opus-5-5

Review passed on bdd6de3. Model: opus-5-5
clawbot added 1 commit 2026-10-02 08:39:39 +02:00
Mattermost is sent by the Slack sender, which wrapped every HTTP error
status in ErrSlackFailed, so a Mattermost endpoint answering 503 was
logged as "slack notification failed". The sender now takes the error
to wrap: the Slack endpoint passes ErrSlackFailed and the Mattermost
endpoint passes ErrMattermostFailed, which was defined but unused.

A new delivery test sets both endpoints to a stand-in server answering
503 and checks the error logged for each names its own endpoint.

Model: opus-5-5
clawbot force-pushed issue-227-mattermost-error-name from bdd6de396c to e3c632c793 2026-10-02 08:39:39 +02:00 Compare
clawbot merged commit 26c9c74d8e into next 2026-10-02 08:40:20 +02:00
clawbot deleted branch issue-227-mattermost-error-name 2026-10-02 08:40:20 +02:00
clawbot removed the needs-review label 2026-10-02 08:40:20 +02:00
Sign in to join this conversation.