Skip to main content

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

AttributeDescription
error.fataltrue for unhandled crashes, false for handled errors
error.sourceAlways "js"
exception.typeError class name (e.g. "TypeError")
exception.messageError message
exception.stacktraceFull JS stack trace
screen.nameCurrent 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:

import com.pulsereactnativeotel.Pulse

Pulse.trackNonFatal(
name = "api_timeout",
observedTimeStampInMs = System.currentTimeMillis(),
params = mapOf("endpoint" to "/api/feed"),
)

Crash instrumentation and trackNonFatal overloads (e.g. caught Throwable / Error): Android APIs · iOS APIs.

Next Steps