JavaScript SDK Reference
Learn how you can reproduce bugs on your local development environment
capture
The capture
function allows you to manually capture errors that you have captured. Useful when you want to continue executing the code, but want to send the bug to Flytrap.
Example usage:
tryCapture
Allows you to call an async function that might throw, and automatically capture the error if it is thrown. Useful for when you want to manually handle error messages and such.
Example usage:
tryCaptureSync
Allows you to call a synchronous function that might throw, and automatically capture the error if it is thrown. Useful for when you want to manually handle error messages and such.
Example usage:
invariant
The invariant
function is super good for type-safe invariant state checks. Because of the type-signature, TypeScript will be happy as well!
Example usage:
invariantAsync
The invariant
function is super good for type-safe invariant state checks. The function will wait for the capture to be sent before throwing the invariant error.
Example usage: