Skip to content

fix: surface actual error message in ntfy test connection#4165

Merged
Siumauricio merged 1 commit intocanaryfrom
fix/ntfy-test-error-message
Apr 5, 2026
Merged

fix: surface actual error message in ntfy test connection#4165
Siumauricio merged 1 commit intocanaryfrom
fix/ntfy-test-error-message

Conversation

@Siumauricio
Copy link
Copy Markdown
Contributor

@Siumauricio Siumauricio commented Apr 5, 2026

Summary

  • The ntfy test connection catch block was returning a generic "Error testing the notification" message, hiding the actual error from the ntfy server (SSL, DNS, auth, etc.)
  • Now includes the underlying error message in the tRPC response so users can actually diagnose the issue

Closes #4047

Greptile Summary

This PR fixes the testNtfyConnection tRPC mutation to surface the underlying error message (SSL, DNS, auth, etc.) instead of the generic \"Error testing the notification\" fallback, directly addressing issue #4047. The change is minimal, correct, and non-breaking.

  • The fix is valid and safe to merge
  • 10 other notification test handlers (testTelegramConnection, testGotifyConnection, testMattermostConnection, testLarkConnection, testPushoverConnection, and more) still swallow the real error behind the same generic message
  • testSlackConnection already surfaces errors but uses a different format (no \"Error testing...\" prefix, \"Unknown error\" fallback), creating a minor inconsistency across handlers

Confidence Score: 4/5

Safe to merge — the change is a small, targeted improvement to error reporting with no functional risk.

The change is correct and non-breaking. The only concern is incomplete coverage (other handlers still use generic messages), but this does not block the fix from being merged.

No files require special attention; the single changed file (notification.ts) contains the complete, self-contained fix.

Reviews (1): Last reviewed commit: "fix: surface actual error message in ntf..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

The catch block was swallowing the real error from the ntfy server,
making it impossible to diagnose connection failures (e.g. SSL, DNS,
auth issues). Now the underlying error message is included in the
tRPC error response.

Closes #4047
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 5, 2026
@dosubot dosubot bot added the bug Something isn't working label Apr 5, 2026
@Siumauricio Siumauricio merged commit a6db83c into canary Apr 5, 2026
5 checks passed
@Siumauricio Siumauricio deleted the fix/ntfy-test-error-message branch April 5, 2026 20:11
Comment on lines 678 to 685
throw new TRPCError({
code: "BAD_REQUEST",
message: "Error testing the notification",
message:
error instanceof Error
? `Error testing the notification: ${error.message}`
: "Error testing the notification",
cause: error,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Fix only applied to ntfy — other handlers still hide errors

This fix correctly surfaces the actual error message for testNtfyConnection, but the same problem exists in 10 other test connection handlers that still return the generic "Error testing the notification" message:

  • testTelegramConnection (~line 218)
  • testDiscordConnection (~line 282)
  • testEmailConnection (~line 352)
  • testResendConnection (~line 418)
  • testGotifyConnection (~line 611)
  • testMattermostConnection (~line 749)
  • testCustomConnection (~line 804)
  • testLarkConnection (~line 876)
  • testTeamsConnection (~line 935)
  • testPushoverConnection (~line 1009)

Additionally, testSlackConnection (~line 154) already surfaces errors but with a slightly different format — no prefix and "Unknown error" as the fallback — creating a minor inconsistency:

// testSlackConnection (existing)
message: `${error instanceof Error ? error.message : "Unknown error"}`

// testNtfyConnection (this PR)
message: error instanceof Error
  ? `Error testing the notification: ${error.message}`
  : "Error testing the notification"

Consider extending this fix to all test connection handlers and aligning on a consistent error message format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ntfy notifications are not working after 0.28.7

1 participant