1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const notifier_1 = require("./notifier");
|
4 | class ErrorReporter {
|
5 | constructor(notifier) {
|
6 | this.notifier = notifier;
|
7 | }
|
8 | reportError(error) {
|
9 | if (process.env.NODE_ENV === 'production') {
|
10 | }
|
11 | else if (process.env.NODE_ENV !== 'test') {
|
12 | console.error(error);
|
13 | }
|
14 | this.notifier.emit(notifier_1.GraphiteEvent.DidError, { error });
|
15 | }
|
16 | onError(handler) {
|
17 | return this.notifier.on(notifier_1.GraphiteEvent.DidError, handler);
|
18 | }
|
19 | }
|
20 | exports.errorReporter = new ErrorReporter(notifier_1.createNotifier());
|
21 |
|
\ | No newline at end of file |