Auto-capture
As soon as you call Pionne.init(), the SDK installs three global mechanisms to catch what would normally fall through the cracks.
1. Unhandled JS errors
Section titled “1. Unhandled JS errors”Pionne hooks into ErrorUtils.setGlobalHandler (standard React Native mechanism). Any exception that bubbles up to the render loop without being caught is captured with mechanism: { type: 'global', handled: false }.
// Captured automatically, no code requiredfunction MyScreen() { throw new Error('Boom');}2. Rejected promises (Hermes)
Section titled “2. Rejected promises (Hermes)”On Hermes, Pionne enables HermesInternal.enablePromiseRejectionTracker:
// Both of these are capturedfetch('/x').then((r) => r.nopeNotAFunction());
(async () => { throw new Error('async crash');})();3. Errors in timers
Section titled “3. Errors in timers”Pionne wraps setTimeout, setInterval and requestAnimationFrame to catch exceptions that escape the callback:
setTimeout(() => { throw new Error('Timer crash'); // captured with mechanism.type = 'timer'}, 1000);Limits in development mode
Section titled “Limits in development mode”| Case | Behavior |
|---|---|
| Dev RedBox | Shown by RN, the event is also sent |
| HMR / Fast Refresh | Handlers are preserved across reloads |
| Hermes in dev | Promise tracker active only after Pionne.init |
| Metro symbolication | Readable stacks in dev, see source maps for prod |
Disable in development
Section titled “Disable in development”The SDK sends everything by default, even in dev. If you only want prod:
Pionne.init({ token: '...', enabled: !__DEV__, // no sending in dev});Test the auto-capture
Section titled “Test the auto-capture”<Button title="Crash sync" onPress={() => { throw new Error('sync'); }} /><Button title="Crash async" onPress={async () => { throw new Error('async'); }} /><Button title="Crash timer" onPress={() => setTimeout(() => { throw new Error('timer'); }, 100)} />All three should appear in the dashboard without any try/catch.