Skip to content

Commit 12f0855

Browse files
committed
fix(bugsnag): filter handled gRPC INTERNAL errors from reporting
INTERNAL is a server-side gRPC status and not actionable from the client. Drop handled occurrences in the Bugsnag OnErrorCallback so unhandled crashes still surface real bugs.
1 parent 7c29e9a commit 12f0855

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/debug/FlipcashBugsnagErrorCallback.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ internal val FlipcashErrorCallback = OnErrorCallback onError@{ event ->
1212
return@onError false
1313
}
1414

15-
// Only tag unhandled errors — handled errors go through ErrorUtils.handleError()
15+
// Discard handled gRPC INTERNAL — server-side errors, not actionable from the client
16+
if (!event.isUnhandled && cause is StatusException && cause.status.code == io.grpc.Status.Code.INTERNAL) {
17+
return@onError false
18+
}
19+
1620
if (!event.isUnhandled) return@onError true
1721

18-
event.addMetadata("alert", "slack_notify", true)
19-
event.addMetadata("alert", "error_type", cause.javaClass.simpleName)
20-
event.addMetadata("alert", "error_family", cause.javaClass.enclosingClass?.simpleName ?: "Unknown")
2122
true
2223
}

0 commit comments

Comments
 (0)