Skip to content

Commit cb71147

Browse files
committed
chore: simplify handling of errors dispatched to busnag
Reduce volume of errors sent to bugsnag to only allow actionable, unexpected errors (notifiable) Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 2e0d9c8 commit cb71147

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/startup/BugsnagErrorReporter.kt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,8 @@ import com.getcode.utils.ErrorReporter
55

66
class BugsnagErrorReporter : ErrorReporter {
77
override fun report(error: Throwable, cause: Throwable, isNotifiable: Boolean) {
8+
if (!isNotifiable) return
89
if (!Bugsnag.isStarted()) return
9-
Bugsnag.notify(error) { event ->
10-
if (isNotifiable) {
11-
event.addMetadata("alert", "slack_notify", true)
12-
event.addMetadata("alert", "error_type", cause.javaClass.simpleName)
13-
event.addMetadata(
14-
"alert", "error_family",
15-
cause.javaClass.enclosingClass?.simpleName ?: "Unknown"
16-
)
17-
}
18-
true
19-
}
10+
Bugsnag.notify(error)
2011
}
2112
}

0 commit comments

Comments
 (0)