Error Instrumentation
Generates: Logs
Automatically captures unhandled JavaScript exceptions and promise rejections. Also supports manual error reporting.
Configuration
On by default. To disable automatic capture:
Pulse.start({ autoDetectExceptions: false });
You can still report errors manually even when auto-detect is off.
Manual Reporting
import { Pulse } from '@dreamhorizonorg/pulse-react-native';
// Report a caught error
try {
await riskyOperation();
} catch (error) {
Pulse.reportException(error);
}
// Report as fatal
Pulse.reportException(error, true);
// With additional context
Pulse.reportException(error, false, {
operation: 'checkout',
userId: 'user-123',
});
Attributes
| Attribute | Description |
|---|---|
error.fatal | true for unhandled crashes, false for handled errors |
error.source | Always "js" |
exception.type | Error class name (e.g. "TypeError") |
exception.message | Error message |
exception.stacktrace | Full JS stack trace |
screen.name | Current screen (requires Navigation setup) |
When an error occurs during an active span, span_id and trace_id are included for correlation.
Native side
Report non-fatal issues from Kotlin or Swift:
- Kotlin (Android)
- Swift (iOS)
import com.pulsereactnativeotel.Pulse
Pulse.trackNonFatal(
name = "api_timeout",
observedTimeStampInMs = System.currentTimeMillis(),
params = mapOf("endpoint" to "/api/feed"),
)
import PulseReactNativeOtel
PulseSDK.trackNonFatal(
name: "api_timeout",
observedTimeStampInMs: Int64(Date().timeIntervalSince1970 * 1000),
params: [:]
)
Crash instrumentation and trackNonFatal overloads (e.g. caught Throwable / Error): Android APIs · iOS APIs.
Next Steps
- Error Boundaries — Catch React render errors with fallback UI