Table of contents

How to create a Catcher

If you read this page then you want to create your own catcher module for the language we do not support yet or any other custom system.

This document contains the list of features that should be supported by every catcher

  1. Bind global error handler
  2. Send caught errors to the hawk using universal Event Format
  3. Collect and send code fragments for each line of Stacktrace
  4. Allow to send events to the Hawk manually 
  5. Allow users to specify free-format context object with any data. Context can be specified globally (on initialization) and with every manually sent event. If both present, they should be merged.
  6. Allow passing user object with a currently authenticated user, see Event Format. When user is not specified, the catcher should generate user with {id: 'user-unique token'} so Hawk can calculate Affected Users count.
  7. The catcher can pass language-specific data through the addons field
  8. If possible, runtime variables values should be extracted from the Stacktrace and passed to the Hawk.
  9. Send own version with event. Needed for source maps and suspected commits.
  10. If Catcher works on the backend side, it can send Suspected Commits using git.
  11. If possible, the Catcher should send error levels (Fatal, Warning, etc)
  12. If possible, the Catcher should have an interface for integration with popular loggers. For example, Monolog for PHP.