1.0.0 • Published 6 years ago

hawk.nodejs v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

hawk.nodejs

Node.js errors Catcher module for Hawk.so

Usage

Register an account and get a project token.

Install module

Use npm to install Catcher

$ npm update

Download and require node.js file

You can download this repository and require Hawk.nodejs file in your project.

require './hawk.nodejs/hawk/hawk';

Init HawkCatcher

Create an instance with token to the entry point of your project.

var hawkCatcher = require('./hawk.nodejs/hawk/hawk')({
  accessToken: "69d86244-f792-47ad-8e9a-23fee358e062"
});

Custom Hawk server

If you want to use custom Hawk server then pass a url to this catcher.

var hawkCatcher = require('./hawk.nodejs/hawk/hawk')({
  accessToken: "69d86244-f792-47ad-8e9a-23fee358e062",
  url: "https://myownhawk.com/catcher/nodejs"
});

Catch exception

You can catch exceptions by yourself without enabling handlers.

try {
  throw new Exception("");
} catch (e) {
  hawkCatcher.catchException(e, {comment: "Exception in general module"});
}

Links

Repository: https://github.com/codex-team/hawk.nodejs

Report a bug: https://github.com/codex-team/hawk.nodejs/issues

CodeX Team: https://ifmo.su