fix: surface actual error message in ntfy test connection#4165
Merged
Siumauricio merged 1 commit intocanaryfrom Apr 5, 2026
Merged
fix: surface actual error message in ntfy test connection#4165Siumauricio merged 1 commit intocanaryfrom
Siumauricio merged 1 commit intocanaryfrom
Conversation
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
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, | ||
| }); |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"Error testing the notification"message, hiding the actual error from the ntfy server (SSL, DNS, auth, etc.)Closes #4047
Greptile Summary
This PR fixes the
testNtfyConnectiontRPC 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.testTelegramConnection,testGotifyConnection,testMattermostConnection,testLarkConnection,testPushoverConnection, and more) still swallow the real error behind the same generic messagetestSlackConnectionalready surfaces errors but uses a different format (no\"Error testing...\"prefix,\"Unknown error\"fallback), creating a minor inconsistency across handlersConfidence 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