mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-25 06:05:52 +02:00
Revert codestyle changes (#40)
* Revert "7f7efbb94bab8574e42d942ad82d414e007b2970" Code style changes should probably be part of a PR
This commit is contained in:
@@ -8,54 +8,54 @@ import { rollbarCheckIgnore, isIgnoredError } from '../../common/rollbar';
|
||||
const host = typeof location === 'undefined' ? '' : location.host;
|
||||
|
||||
const rollbarConfig = {
|
||||
environment: ROLLBAR_ENV,
|
||||
accessToken: ROLLBAR_TOKEN,
|
||||
ignoredMessages: ['disconnected'],
|
||||
hostWhiteList: [host],
|
||||
captureUncaught: true,
|
||||
captureUnhandleRejections: true,
|
||||
// checkIgnore,
|
||||
enabled: true,
|
||||
payload: {
|
||||
environment: ROLLBAR_ENV,
|
||||
version: version, // NOTE: workaround for compilation issue
|
||||
client: {
|
||||
javascript: {
|
||||
source_map_enabled: true,
|
||||
guess_uncaught_frames: true,
|
||||
code_version: HASH,
|
||||
},
|
||||
},
|
||||
},
|
||||
environment: ROLLBAR_ENV,
|
||||
accessToken: ROLLBAR_TOKEN,
|
||||
ignoredMessages: ['disconnected'],
|
||||
hostWhiteList: [host],
|
||||
captureUncaught: true,
|
||||
captureUnhandleRejections: true,
|
||||
// checkIgnore,
|
||||
enabled: true,
|
||||
payload: {
|
||||
environment: ROLLBAR_ENV,
|
||||
version: version, // NOTE: workaround for compilation issue
|
||||
client: {
|
||||
javascript: {
|
||||
source_map_enabled: true,
|
||||
guess_uncaught_frames: true,
|
||||
code_version: HASH,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const RollbarService = new InjectionToken<Rollbar>('rollbar');
|
||||
|
||||
export function rollbarFactory() {
|
||||
if (DEVELOPMENT) {
|
||||
return undefined;
|
||||
} else {
|
||||
const rollbar = Rollbar.init(rollbarConfig);
|
||||
rollbar.configure({ checkIgnore: rollbarCheckIgnore });
|
||||
return rollbar;
|
||||
}
|
||||
if (DEVELOPMENT) {
|
||||
return undefined;
|
||||
} else {
|
||||
const rollbar = Rollbar.init(rollbarConfig);
|
||||
rollbar.configure({ checkIgnore: rollbarCheckIgnore });
|
||||
return rollbar;
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class RollbarErrorHandler extends ErrorHandler {
|
||||
constructor(private injector: Injector) {
|
||||
super();
|
||||
}
|
||||
handleError(error: any) {
|
||||
super.handleError(error);
|
||||
constructor(private injector: Injector) {
|
||||
super();
|
||||
}
|
||||
handleError(error: any) {
|
||||
super.handleError(error);
|
||||
|
||||
if (!DEVELOPMENT && rollbarConfig.accessToken) {
|
||||
const rollbar = this.injector.get(RollbarService);
|
||||
const err = error.originalError || error || {};
|
||||
if (!DEVELOPMENT && rollbarConfig.accessToken) {
|
||||
const rollbar = this.injector.get(RollbarService);
|
||||
const err = error.originalError || error || {};
|
||||
|
||||
if (!isIgnoredError(err)) {
|
||||
rollbar.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isIgnoredError(err)) {
|
||||
rollbar.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user