mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Created typings for honeybadger module * slight improvements to typings, tslint now has no extra rules. * Update index.d.ts * Update index.d.ts
39 lines
821 B
TypeScript
39 lines
821 B
TypeScript
import Honeybadger = require("honeybadger");
|
|
|
|
Honeybadger.configure({
|
|
apiKey: "abcdef"
|
|
});
|
|
|
|
const err = Error("error");
|
|
|
|
Honeybadger.notify(err, function notifyCallback(err: Error, notice: any) {
|
|
if (err) console.error(err);
|
|
console.log(notice);
|
|
});
|
|
|
|
Honeybadger.setContext({
|
|
user_id: 123
|
|
});
|
|
|
|
Honeybadger.resetContext();
|
|
|
|
Honeybadger.resetContext({
|
|
user_id: 123
|
|
});
|
|
|
|
const other_hb = Honeybadger.factory({apiKey: "zxcvbnm"});
|
|
other_hb.notify("This will go to an alternate project.");
|
|
|
|
Honeybadger.onUncaughtException(err => {
|
|
console.log(err);
|
|
});
|
|
|
|
function handler(event: any, context: any) {
|
|
console.log('Event:', event);
|
|
console.log('Context:', context);
|
|
throw(new Error('Something went wrong.'));
|
|
console.log("Shouldn't make it here.");
|
|
}
|
|
|
|
exports.handler = Honeybadger.lambdaHandler(handler);
|