-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
Hi !
The standard init of rg4js for Angular ErrorHandler working good :
import * as rg4js from 'raygun4js';
import { ErrorHandler } from '@angular/core';
const VERSION_NUMBER = '1.0.0.0';
rg4js('apiKey', "apiKey");
rg4js('setVersion', VERSION_NUMBER);
rg4js('enableCrashReporting', true);
export class RaygunErrorHandler implements ErrorHandler {
handleError(e: any) {
rg4js('send', {
error: e,
});
}
}But that doesn't work correctly if we move the init into a constructor :
import * as rg4js from 'raygun4js';
import { ErrorHandler } from '@angular/core';
export class RaygunErrorHandler implements ErrorHandler {
constructor() {
const VERSION_NUMBER = '1.0.0.0';
rg4js('apiKey', "apiKey");
rg4js('setVersion', VERSION_NUMBER);
rg4js('enableCrashReporting', true);
}
handleError(e: any) {
rg4js('send', {
error: e,
});
}
}Do you have an idea? I would need this to get my configuration and my apiKey from an Angular service.
Thank you !
Reactions are currently unavailable