Skip to content

Commit 7f4b8a8

Browse files
authored
Bug 2015831 - API for recording Rust component errors (#7213)
1 parent 3e3e15e commit 7f4b8a8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
### Viaduct
7575
* Support setting default user-agent headers.
7676

77+
### Error support
78+
* Added the `RustComponentsErrorTelemetry.submitErrorPing` method to allow Android consumers to submit rust components error pings.
79+
7780
[Full Changelog](In progress)
7881

7982
# v148.0 (_2026-01-12_)

components/support/error/android/src/main/java/mozilla/appservices/errorsupport/RustComponentsErrorTelemetry.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ public object RustComponentsErrorTelemetry {
3030
Glean.registerPings(Pings)
3131
registerEventSink("app-services-error-reporter", TracingLevel.DEBUG, ErrorEventSink())
3232
}
33+
34+
/**
35+
* Submit an error ping.
36+
*
37+
* This is intended to be used for corner cases where we can't record the error in Rust directly.
38+
* For example, `UniffiInternalError` which happens in the generated bindings.
39+
*/
40+
fun submitErrorPing(typeName: String, message: String) {
41+
RustComponentErrors.errorType.set(typeName)
42+
RustComponentErrors.details.set(message)
43+
// Unfortunately, there's no easy way to support breadcrumbs in this case.
44+
Pings.rustComponentErrors.submit()
45+
}
3346
}
3447

3548
@Serializable

0 commit comments

Comments
 (0)