vc-error-handlers 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/shared/errorhandler/sentry-error.handler.mjs +2 -1
- package/esm2020/lib/vc-error-handlers.module.mjs +14 -4
- package/fesm2015/vc-error-handlers.mjs +14 -3
- package/fesm2015/vc-error-handlers.mjs.map +1 -1
- package/fesm2020/vc-error-handlers.mjs +14 -3
- package/fesm2020/vc-error-handlers.mjs.map +1 -1
- package/lib/vc-error-handlers.module.d.ts +2 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
import * as i1 from "../../configuration";
|
|
5
5
|
export class SentryErrorHandler {
|
|
6
6
|
constructor(config) {
|
|
7
|
+
console.log('sentry config datra ', config);
|
|
7
8
|
if (config?.sentryConfig) {
|
|
8
9
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
9
10
|
Sentry.init({
|
|
@@ -39,4 +40,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
39
40
|
}], ctorParameters: function () { return [{ type: i1.Configurations, decorators: [{
|
|
40
41
|
type: Optional
|
|
41
42
|
}] }]; } });
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VudHJ5LWVycm9yLmhhbmRsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy92Yy1lcnJvci1oYW5kbGVycy9zcmMvbGliL3NoYXJlZC9lcnJvcmhhbmRsZXIvc2VudHJ5LWVycm9yLmhhbmRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFnQixVQUFVLEVBQUUsUUFBUSxFQUFhLE1BQU0sZU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mFjZVByb3BhZ2F0aW9uVGFyZ2V0czogU0VOVFJZX0NPTkZJRy5BTExPV19PUklHSU4sXHJcbiAgICAgICAgICAgIHJvdXRpbmdJbnN0cnVtZW50YXRpb246IFNlbnRyeS5yb3V0aW5nSW5zdHJ1bWVudGF0aW9uLFxyXG4gICAgICAgICAgfSksXHJcbiAgICAgICAgXSxcclxuICAgICAgICB0cmFjZXNTYW1wbGVSYXRlOiBTRU5UUllfQ09ORklHLlRSQUNFU19TQU1QTEVfUkFURSxcclxuICAgICAgICByZXBsYXlzU2Vzc2lvblNhbXBsZVJhdGU6IFNFTlRSWV9DT05GSUcuUkVQTEFZX1NFU1NJT05fU0FNUExFX1JBVEUsXHJcbiAgICAgICAgcmVwbGF5c09uRXJyb3JTYW1wbGVSYXRlOiBTRU5UUllfQ09ORklHLlJFUExBWV9PTl9FUlJPUl9TQU1QTEVfUkFURSxcclxuICAgICAgfSk7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICBoYW5kbGVFcnJvcihlcnJvcjogYW55KSB7XHJcbiAgICB0aGlzLmhhbmRsZUNodW5rRXJyb3IoZXJyb3IpO1xyXG4gICAgU2VudHJ5LmNhcHR1cmVFeGNlcHRpb24oZXJyb3Iub3JpZ2luYWxFcnJvciB8fCBlcnJvcik7XHJcbiAgfVxyXG5cclxuICBoYW5kbGVDaHVua0Vycm9yKGVycm9yOiBFcnJvcikge1xyXG4gICAgY29uc3QgY2h1bmtGYWlsZWRNZXNzYWdlID0gL0xvYWRpbmcgY2h1bmsgW1xcZF0rIGZhaWxlZC87XHJcbiAgICBpZiAoY2h1bmtGYWlsZWRNZXNzYWdlLnRlc3QoZXJyb3IubWVzc2FnZSkpIHtcclxuICAgICAgd2luZG93LmxvY2F0aW9uLnJlbG9hZCgpO1xyXG4gICAgfVxyXG4gICAgY29uc29sZS5lcnJvcihlcnJvcik7XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -6,14 +6,13 @@ import { Configurations } from './configuration';
|
|
|
6
6
|
import { Router } from '@angular/router';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
9
|
-
export function sentryInit() { }
|
|
9
|
+
export function sentryInit(SentryErrorHandler) { }
|
|
10
10
|
export class VcErrorHandlersModule {
|
|
11
11
|
static forRoot(environmentConfig) {
|
|
12
12
|
return {
|
|
13
13
|
ngModule: VcErrorHandlersModule,
|
|
14
14
|
providers: [
|
|
15
15
|
{ provide: Configurations, useValue: environmentConfig },
|
|
16
|
-
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
17
16
|
{
|
|
18
17
|
provide: ErrorHandler,
|
|
19
18
|
useValue: Sentry.createErrorHandler({
|
|
@@ -27,13 +26,24 @@ export class VcErrorHandlersModule {
|
|
|
27
26
|
}
|
|
28
27
|
VcErrorHandlersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
29
28
|
VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, declarations: [VcErrorHandlersComponent], exports: [VcErrorHandlersComponent] });
|
|
30
|
-
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule,
|
|
29
|
+
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
30
|
+
{
|
|
31
|
+
provide: ErrorHandler,
|
|
32
|
+
useClass: SentryErrorHandler,
|
|
33
|
+
},
|
|
34
|
+
], imports: [[]] });
|
|
31
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, decorators: [{
|
|
32
36
|
type: NgModule,
|
|
33
37
|
args: [{
|
|
34
38
|
declarations: [VcErrorHandlersComponent],
|
|
35
39
|
imports: [],
|
|
36
40
|
exports: [VcErrorHandlersComponent],
|
|
41
|
+
providers: [
|
|
42
|
+
{
|
|
43
|
+
provide: ErrorHandler,
|
|
44
|
+
useClass: SentryErrorHandler,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
37
47
|
}]
|
|
38
48
|
}] });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmMtZXJyb3ItaGFuZGxlcnMubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvdmMtZXJyb3ItaGFuZGxlcnMvc3JjL2xpYi92Yy1lcnJvci1oYW5kbGVycy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLFlBQVksRUFDWixjQUFjLEVBRWQsUUFBUSxHQUNULE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXpFLE9BQU8sS0FBSyxNQUFNLE1BQU0scUJBQXFCLENBQUM7QUFDOUMsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sNENBQTRDLENBQUM7QUFDaEYsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2pELE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7QUFFekMsTUFBTSxDQUFDLE1BQU0sNkJBQTZCLEdBQUcsSUFBSSxjQUFjLENBQzdELHNDQUFzQyxDQUN2QyxDQUFDO0FBRUYsTUFBTSxVQUFVLFVBQVUsQ0FBQ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wb25lbnRdLFxyXG4gIHByb3ZpZGVyczogW1xyXG4gICAge1xyXG4gICAgICBwcm92aWRlOiBFcnJvckhhbmRsZXIsXHJcbiAgICAgIHVzZUNsYXNzOiBTZW50cnlFcnJvckhhbmRsZXIsXHJcbiAgICB9LFxyXG4gIF0sXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBWY0Vycm9ySGFuZGxlcnNNb2R1bGUge1xyXG4gIHB1YmxpYyBzdGF0aWMgZm9yUm9vdChcclxuICAgIGVudmlyb25tZW50Q29uZmlnOiBDb25maWd1cmF0aW9uc1xyXG4gICk6IE1vZHVsZVdpdGhQcm92aWRlcnM8VmNFcnJvckhhbmRsZXJzTW9kdWxlPiB7XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICBuZ01vZHVsZTogVmNFcnJvckhhbmRsZXJzTW9kdWxlLFxyXG4gICAgICBwcm92aWRlcnM6IFtcclxuICAgICAgICB7IHByb3ZpZGU6IENvbmZpZ3VyYXRpb25zLCB1c2VWYWx1ZTogZW52aXJvbm1lbnRDb25maWcgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICBwcm92aWRlOiBFcnJvckhhbmRsZXIsXHJcbiAgICAgICAgICB1c2VWYWx1ZTogU2VudHJ5LmNyZWF0ZUVycm9ySGFuZGxlcih7XHJcbiAgICAgICAgICAgIHNob3dEaWFsb2c6IGZhbHNlLFxyXG4gICAgICAgICAgfSksXHJcbiAgICAgICAgfSxcclxuICAgICAgICB7IHByb3ZpZGU6IFNlbnRyeS5UcmFjZVNlcnZpY2UsIGRlcHM6IFtSb3V0ZXJdIH0sXHJcbiAgICAgIF0sXHJcbiAgICB9O1xyXG4gIH1cclxufVxyXG4iXX0=
|
|
@@ -47,6 +47,7 @@ class Configurations {
|
|
|
47
47
|
|
|
48
48
|
class SentryErrorHandler {
|
|
49
49
|
constructor(config) {
|
|
50
|
+
console.log('sentry config datra ', config);
|
|
50
51
|
if (config === null || config === void 0 ? void 0 : config.sentryConfig) {
|
|
51
52
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
52
53
|
Sentry.init({
|
|
@@ -86,14 +87,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
86
87
|
} });
|
|
87
88
|
|
|
88
89
|
const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
89
|
-
function sentryInit() { }
|
|
90
|
+
function sentryInit(SentryErrorHandler) { }
|
|
90
91
|
class VcErrorHandlersModule {
|
|
91
92
|
static forRoot(environmentConfig) {
|
|
92
93
|
return {
|
|
93
94
|
ngModule: VcErrorHandlersModule,
|
|
94
95
|
providers: [
|
|
95
96
|
{ provide: Configurations, useValue: environmentConfig },
|
|
96
|
-
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
97
97
|
{
|
|
98
98
|
provide: ErrorHandler,
|
|
99
99
|
useValue: Sentry.createErrorHandler({
|
|
@@ -107,13 +107,24 @@ class VcErrorHandlersModule {
|
|
|
107
107
|
}
|
|
108
108
|
VcErrorHandlersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
109
109
|
VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, declarations: [VcErrorHandlersComponent], exports: [VcErrorHandlersComponent] });
|
|
110
|
-
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule,
|
|
110
|
+
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
111
|
+
{
|
|
112
|
+
provide: ErrorHandler,
|
|
113
|
+
useClass: SentryErrorHandler,
|
|
114
|
+
},
|
|
115
|
+
], imports: [[]] });
|
|
111
116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, decorators: [{
|
|
112
117
|
type: NgModule,
|
|
113
118
|
args: [{
|
|
114
119
|
declarations: [VcErrorHandlersComponent],
|
|
115
120
|
imports: [],
|
|
116
121
|
exports: [VcErrorHandlersComponent],
|
|
122
|
+
providers: [
|
|
123
|
+
{
|
|
124
|
+
provide: ErrorHandler,
|
|
125
|
+
useClass: SentryErrorHandler,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
117
128
|
}]
|
|
118
129
|
}] });
|
|
119
130
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-error-handlers.mjs","sources":["../../../projects/vc-error-handlers/src/lib/vc-error-handlers.service.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.component.ts","../../../projects/vc-error-handlers/src/lib/configuration.ts","../../../projects/vc-error-handlers/src/lib/shared/errorhandler/sentry-error.handler.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.module.ts","../../../projects/vc-error-handlers/src/public-api.ts","../../../projects/vc-error-handlers/src/vc-error-handlers.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class VcErrorHandlersService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-vc-error-handlers',\r\n template: `\r\n <p>\r\n vc-error-handlers works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class VcErrorHandlersComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","export class Configurations {\r\n public sentryConfig: any;\r\n\r\n constructor() {\r\n this.sentryConfig = {};\r\n }\r\n}\r\n","import { ErrorHandler, Injectable, Optional, isDevMode } from '@angular/core';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { Configurations } from '../../configuration';\r\n\r\n@Injectable()\r\nexport class SentryErrorHandler implements ErrorHandler {\r\n constructor(@Optional() config?: Configurations) {\r\n if (config?.sentryConfig) {\r\n const SENTRY_CONFIG = config.sentryConfig;\r\n Sentry.init({\r\n dsn: SENTRY_CONFIG?.DSN,\r\n integrations: [\r\n new Sentry.BrowserTracing({\r\n tracePropagationTargets: SENTRY_CONFIG.ALLOW_ORIGIN,\r\n routingInstrumentation: Sentry.routingInstrumentation,\r\n }),\r\n ],\r\n tracesSampleRate: SENTRY_CONFIG.TRACES_SAMPLE_RATE,\r\n replaysSessionSampleRate: SENTRY_CONFIG.REPLAY_SESSION_SAMPLE_RATE,\r\n replaysOnErrorSampleRate: SENTRY_CONFIG.REPLAY_ON_ERROR_SAMPLE_RATE,\r\n });\r\n }\r\n }\r\n\r\n handleError(error: any) {\r\n this.handleChunkError(error);\r\n Sentry.captureException(error.originalError || error);\r\n }\r\n\r\n handleChunkError(error: Error) {\r\n const chunkFailedMessage = /Loading chunk [\\d]+ failed/;\r\n if (chunkFailedMessage.test(error.message)) {\r\n window.location.reload();\r\n }\r\n console.error(error);\r\n }\r\n}\r\n","import {\r\n APP_INITIALIZER,\r\n ErrorHandler,\r\n InjectionToken,\r\n ModuleWithProviders,\r\n NgModule,\r\n} from '@angular/core';\r\nimport { VcErrorHandlersComponent } from './vc-error-handlers.component';\r\nimport { BrowserOptions } from '@sentry/browser';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { SentryErrorHandler } from './shared/errorhandler/sentry-error.handler';\r\nimport { Configurations } from './configuration';\r\nimport { Router } from '@angular/router';\r\n\r\nexport const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken<BrowserOptions>(\r\n 'forRoot() SentryErrorHandler options'\r\n);\r\n\r\nexport function sentryInit() {}\r\n\r\n@NgModule({\r\n declarations: [VcErrorHandlersComponent],\r\n imports: [],\r\n exports: [VcErrorHandlersComponent],\r\n})\r\nexport class VcErrorHandlersModule {\r\n public static forRoot(\r\n environmentConfig: Configurations\r\n ): ModuleWithProviders<VcErrorHandlersModule> {\r\n return {\r\n ngModule: VcErrorHandlersModule,\r\n providers: [\r\n { provide: Configurations, useValue: environmentConfig },\r\n {
|
|
1
|
+
{"version":3,"file":"vc-error-handlers.mjs","sources":["../../../projects/vc-error-handlers/src/lib/vc-error-handlers.service.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.component.ts","../../../projects/vc-error-handlers/src/lib/configuration.ts","../../../projects/vc-error-handlers/src/lib/shared/errorhandler/sentry-error.handler.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.module.ts","../../../projects/vc-error-handlers/src/public-api.ts","../../../projects/vc-error-handlers/src/vc-error-handlers.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class VcErrorHandlersService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-vc-error-handlers',\r\n template: `\r\n <p>\r\n vc-error-handlers works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class VcErrorHandlersComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","export class Configurations {\r\n public sentryConfig: any;\r\n\r\n constructor() {\r\n this.sentryConfig = {};\r\n }\r\n}\r\n","import { ErrorHandler, Injectable, Optional, isDevMode } from '@angular/core';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { Configurations } from '../../configuration';\r\n\r\n@Injectable()\r\nexport class SentryErrorHandler implements ErrorHandler {\r\n constructor(@Optional() config?: Configurations) {\r\n console.log('sentry config datra ', config);\r\n if (config?.sentryConfig) {\r\n const SENTRY_CONFIG = config.sentryConfig;\r\n Sentry.init({\r\n dsn: SENTRY_CONFIG?.DSN,\r\n integrations: [\r\n new Sentry.BrowserTracing({\r\n tracePropagationTargets: SENTRY_CONFIG.ALLOW_ORIGIN,\r\n routingInstrumentation: Sentry.routingInstrumentation,\r\n }),\r\n ],\r\n tracesSampleRate: SENTRY_CONFIG.TRACES_SAMPLE_RATE,\r\n replaysSessionSampleRate: SENTRY_CONFIG.REPLAY_SESSION_SAMPLE_RATE,\r\n replaysOnErrorSampleRate: SENTRY_CONFIG.REPLAY_ON_ERROR_SAMPLE_RATE,\r\n });\r\n }\r\n }\r\n\r\n handleError(error: any) {\r\n this.handleChunkError(error);\r\n Sentry.captureException(error.originalError || error);\r\n }\r\n\r\n handleChunkError(error: Error) {\r\n const chunkFailedMessage = /Loading chunk [\\d]+ failed/;\r\n if (chunkFailedMessage.test(error.message)) {\r\n window.location.reload();\r\n }\r\n console.error(error);\r\n }\r\n}\r\n","import {\r\n APP_INITIALIZER,\r\n ErrorHandler,\r\n InjectionToken,\r\n ModuleWithProviders,\r\n NgModule,\r\n} from '@angular/core';\r\nimport { VcErrorHandlersComponent } from './vc-error-handlers.component';\r\nimport { BrowserOptions } from '@sentry/browser';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { SentryErrorHandler } from './shared/errorhandler/sentry-error.handler';\r\nimport { Configurations } from './configuration';\r\nimport { Router } from '@angular/router';\r\n\r\nexport const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken<BrowserOptions>(\r\n 'forRoot() SentryErrorHandler options'\r\n);\r\n\r\nexport function sentryInit(SentryErrorHandler: SentryErrorHandler) {}\r\n\r\n@NgModule({\r\n declarations: [VcErrorHandlersComponent],\r\n imports: [],\r\n exports: [VcErrorHandlersComponent],\r\n providers: [\r\n {\r\n provide: ErrorHandler,\r\n useClass: SentryErrorHandler,\r\n },\r\n ],\r\n})\r\nexport class VcErrorHandlersModule {\r\n public static forRoot(\r\n environmentConfig: Configurations\r\n ): ModuleWithProviders<VcErrorHandlersModule> {\r\n return {\r\n ngModule: VcErrorHandlersModule,\r\n providers: [\r\n { provide: Configurations, useValue: environmentConfig },\r\n {\r\n provide: ErrorHandler,\r\n useValue: Sentry.createErrorHandler({\r\n showDialog: false,\r\n }),\r\n },\r\n { provide: Sentry.TraceService, deps: [Router] },\r\n ],\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of vc-error-handlers\r\n */\r\n\r\nexport * from './lib/vc-error-handlers.service';\r\nexport * from './lib/vc-error-handlers.component';\r\nexport * from './lib/vc-error-handlers.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,sBAAsB;IAEjC,iBAAiB;;mHAFN,sBAAsB;uHAAtB,sBAAsB,cAFrB,MAAM;2FAEP,sBAAsB;kBAHlC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;MCQY,wBAAwB;IAEnC,iBAAiB;IAEjB,QAAQ;KACP;;qHALU,wBAAwB;yGAAxB,wBAAwB,6DARzB;;;;GAIT;2FAIU,wBAAwB;kBAVpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;;;GAIT;oBACD,MAAM,EAAE,EACP;iBACF;;;MCXY,cAAc;IAGzB;QACE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;KACxB;;;MCAU,kBAAkB;IAC7B,YAAwB,MAAuB;QAC7C,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;QAC5C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,EAAE;YACxB,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,GAAG;gBACvB,YAAY,EAAE;oBACZ,IAAI,MAAM,CAAC,cAAc,CAAC;wBACxB,uBAAuB,EAAE,aAAa,CAAC,YAAY;wBACnD,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;qBACtD,CAAC;i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,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,kBAAkB;SAC7B;KACF,YAPQ,EAAE;2FASA,qBAAqB;kBAXjC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,YAAY;4BACrB,QAAQ,EAAE,kBAAkB;yBAC7B;qBACF;iBACF;;;AC9BD;;;;ACAA;;;;;;"}
|
|
@@ -47,6 +47,7 @@ class Configurations {
|
|
|
47
47
|
|
|
48
48
|
class SentryErrorHandler {
|
|
49
49
|
constructor(config) {
|
|
50
|
+
console.log('sentry config datra ', config);
|
|
50
51
|
if (config?.sentryConfig) {
|
|
51
52
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
52
53
|
Sentry.init({
|
|
@@ -84,14 +85,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
84
85
|
}] }]; } });
|
|
85
86
|
|
|
86
87
|
const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
87
|
-
function sentryInit() { }
|
|
88
|
+
function sentryInit(SentryErrorHandler) { }
|
|
88
89
|
class VcErrorHandlersModule {
|
|
89
90
|
static forRoot(environmentConfig) {
|
|
90
91
|
return {
|
|
91
92
|
ngModule: VcErrorHandlersModule,
|
|
92
93
|
providers: [
|
|
93
94
|
{ provide: Configurations, useValue: environmentConfig },
|
|
94
|
-
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
95
95
|
{
|
|
96
96
|
provide: ErrorHandler,
|
|
97
97
|
useValue: Sentry.createErrorHandler({
|
|
@@ -105,13 +105,24 @@ class VcErrorHandlersModule {
|
|
|
105
105
|
}
|
|
106
106
|
VcErrorHandlersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
107
107
|
VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, declarations: [VcErrorHandlersComponent], exports: [VcErrorHandlersComponent] });
|
|
108
|
-
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule,
|
|
108
|
+
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
109
|
+
{
|
|
110
|
+
provide: ErrorHandler,
|
|
111
|
+
useClass: SentryErrorHandler,
|
|
112
|
+
},
|
|
113
|
+
], imports: [[]] });
|
|
109
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, decorators: [{
|
|
110
115
|
type: NgModule,
|
|
111
116
|
args: [{
|
|
112
117
|
declarations: [VcErrorHandlersComponent],
|
|
113
118
|
imports: [],
|
|
114
119
|
exports: [VcErrorHandlersComponent],
|
|
120
|
+
providers: [
|
|
121
|
+
{
|
|
122
|
+
provide: ErrorHandler,
|
|
123
|
+
useClass: SentryErrorHandler,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
115
126
|
}]
|
|
116
127
|
}] });
|
|
117
128
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-error-handlers.mjs","sources":["../../../projects/vc-error-handlers/src/lib/vc-error-handlers.service.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.component.ts","../../../projects/vc-error-handlers/src/lib/configuration.ts","../../../projects/vc-error-handlers/src/lib/shared/errorhandler/sentry-error.handler.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.module.ts","../../../projects/vc-error-handlers/src/public-api.ts","../../../projects/vc-error-handlers/src/vc-error-handlers.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class VcErrorHandlersService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-vc-error-handlers',\r\n template: `\r\n <p>\r\n vc-error-handlers works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class VcErrorHandlersComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","export class Configurations {\r\n public sentryConfig: any;\r\n\r\n constructor() {\r\n this.sentryConfig = {};\r\n }\r\n}\r\n","import { ErrorHandler, Injectable, Optional, isDevMode } from '@angular/core';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { Configurations } from '../../configuration';\r\n\r\n@Injectable()\r\nexport class SentryErrorHandler implements ErrorHandler {\r\n constructor(@Optional() config?: Configurations) {\r\n if (config?.sentryConfig) {\r\n const SENTRY_CONFIG = config.sentryConfig;\r\n Sentry.init({\r\n dsn: SENTRY_CONFIG?.DSN,\r\n integrations: [\r\n new Sentry.BrowserTracing({\r\n tracePropagationTargets: SENTRY_CONFIG.ALLOW_ORIGIN,\r\n routingInstrumentation: Sentry.routingInstrumentation,\r\n }),\r\n ],\r\n tracesSampleRate: SENTRY_CONFIG.TRACES_SAMPLE_RATE,\r\n replaysSessionSampleRate: SENTRY_CONFIG.REPLAY_SESSION_SAMPLE_RATE,\r\n replaysOnErrorSampleRate: SENTRY_CONFIG.REPLAY_ON_ERROR_SAMPLE_RATE,\r\n });\r\n }\r\n }\r\n\r\n handleError(error: any) {\r\n this.handleChunkError(error);\r\n Sentry.captureException(error.originalError || error);\r\n }\r\n\r\n handleChunkError(error: Error) {\r\n const chunkFailedMessage = /Loading chunk [\\d]+ failed/;\r\n if (chunkFailedMessage.test(error.message)) {\r\n window.location.reload();\r\n }\r\n console.error(error);\r\n }\r\n}\r\n","import {\r\n APP_INITIALIZER,\r\n ErrorHandler,\r\n InjectionToken,\r\n ModuleWithProviders,\r\n NgModule,\r\n} from '@angular/core';\r\nimport { VcErrorHandlersComponent } from './vc-error-handlers.component';\r\nimport { BrowserOptions } from '@sentry/browser';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { SentryErrorHandler } from './shared/errorhandler/sentry-error.handler';\r\nimport { Configurations } from './configuration';\r\nimport { Router } from '@angular/router';\r\n\r\nexport const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken<BrowserOptions>(\r\n 'forRoot() SentryErrorHandler options'\r\n);\r\n\r\nexport function sentryInit() {}\r\n\r\n@NgModule({\r\n declarations: [VcErrorHandlersComponent],\r\n imports: [],\r\n exports: [VcErrorHandlersComponent],\r\n})\r\nexport class VcErrorHandlersModule {\r\n public static forRoot(\r\n environmentConfig: Configurations\r\n ): ModuleWithProviders<VcErrorHandlersModule> {\r\n return {\r\n ngModule: VcErrorHandlersModule,\r\n providers: [\r\n { provide: Configurations, useValue: environmentConfig },\r\n {
|
|
1
|
+
{"version":3,"file":"vc-error-handlers.mjs","sources":["../../../projects/vc-error-handlers/src/lib/vc-error-handlers.service.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.component.ts","../../../projects/vc-error-handlers/src/lib/configuration.ts","../../../projects/vc-error-handlers/src/lib/shared/errorhandler/sentry-error.handler.ts","../../../projects/vc-error-handlers/src/lib/vc-error-handlers.module.ts","../../../projects/vc-error-handlers/src/public-api.ts","../../../projects/vc-error-handlers/src/vc-error-handlers.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class VcErrorHandlersService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-vc-error-handlers',\r\n template: `\r\n <p>\r\n vc-error-handlers works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class VcErrorHandlersComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","export class Configurations {\r\n public sentryConfig: any;\r\n\r\n constructor() {\r\n this.sentryConfig = {};\r\n }\r\n}\r\n","import { ErrorHandler, Injectable, Optional, isDevMode } from '@angular/core';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { Configurations } from '../../configuration';\r\n\r\n@Injectable()\r\nexport class SentryErrorHandler implements ErrorHandler {\r\n constructor(@Optional() config?: Configurations) {\r\n console.log('sentry config datra ', config);\r\n if (config?.sentryConfig) {\r\n const SENTRY_CONFIG = config.sentryConfig;\r\n Sentry.init({\r\n dsn: SENTRY_CONFIG?.DSN,\r\n integrations: [\r\n new Sentry.BrowserTracing({\r\n tracePropagationTargets: SENTRY_CONFIG.ALLOW_ORIGIN,\r\n routingInstrumentation: Sentry.routingInstrumentation,\r\n }),\r\n ],\r\n tracesSampleRate: SENTRY_CONFIG.TRACES_SAMPLE_RATE,\r\n replaysSessionSampleRate: SENTRY_CONFIG.REPLAY_SESSION_SAMPLE_RATE,\r\n replaysOnErrorSampleRate: SENTRY_CONFIG.REPLAY_ON_ERROR_SAMPLE_RATE,\r\n });\r\n }\r\n }\r\n\r\n handleError(error: any) {\r\n this.handleChunkError(error);\r\n Sentry.captureException(error.originalError || error);\r\n }\r\n\r\n handleChunkError(error: Error) {\r\n const chunkFailedMessage = /Loading chunk [\\d]+ failed/;\r\n if (chunkFailedMessage.test(error.message)) {\r\n window.location.reload();\r\n }\r\n console.error(error);\r\n }\r\n}\r\n","import {\r\n APP_INITIALIZER,\r\n ErrorHandler,\r\n InjectionToken,\r\n ModuleWithProviders,\r\n NgModule,\r\n} from '@angular/core';\r\nimport { VcErrorHandlersComponent } from './vc-error-handlers.component';\r\nimport { BrowserOptions } from '@sentry/browser';\r\nimport * as Sentry from '@sentry/angular-ivy';\r\nimport { SentryErrorHandler } from './shared/errorhandler/sentry-error.handler';\r\nimport { Configurations } from './configuration';\r\nimport { Router } from '@angular/router';\r\n\r\nexport const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken<BrowserOptions>(\r\n 'forRoot() SentryErrorHandler options'\r\n);\r\n\r\nexport function sentryInit(SentryErrorHandler: SentryErrorHandler) {}\r\n\r\n@NgModule({\r\n declarations: [VcErrorHandlersComponent],\r\n imports: [],\r\n exports: [VcErrorHandlersComponent],\r\n providers: [\r\n {\r\n provide: ErrorHandler,\r\n useClass: SentryErrorHandler,\r\n },\r\n ],\r\n})\r\nexport class VcErrorHandlersModule {\r\n public static forRoot(\r\n environmentConfig: Configurations\r\n ): ModuleWithProviders<VcErrorHandlersModule> {\r\n return {\r\n ngModule: VcErrorHandlersModule,\r\n providers: [\r\n { provide: Configurations, useValue: environmentConfig },\r\n {\r\n provide: ErrorHandler,\r\n useValue: Sentry.createErrorHandler({\r\n showDialog: false,\r\n }),\r\n },\r\n { provide: Sentry.TraceService, deps: [Router] },\r\n ],\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of vc-error-handlers\r\n */\r\n\r\nexport * from './lib/vc-error-handlers.service';\r\nexport * from './lib/vc-error-handlers.component';\r\nexport * from './lib/vc-error-handlers.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,sBAAsB;IAEjC,iBAAiB;;mHAFN,sBAAsB;uHAAtB,sBAAsB,cAFrB,MAAM;2FAEP,sBAAsB;kBAHlC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;MCQY,wBAAwB;IAEnC,iBAAiB;IAEjB,QAAQ;KACP;;qHALU,wBAAwB;yGAAxB,wBAAwB,6DARzB;;;;GAIT;2FAIU,wBAAwB;kBAVpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;;;GAIT;oBACD,MAAM,EAAE,EACP;iBACF;;;MCXY,cAAc;IAGzB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iC;QAEjC,OAAO;YACL,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE;gBACxD;oBACE,OAAO,EAAE,YAAY;oBACrB,QAAQ,EAAE,MAAM,CAAC,kBAAkB,CAAC;wBAClC,UAAU,EAAE,KAAK;qBAClB,CAAC;iBACH;gBACD,EAAE,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE;aACjD;SACF,CAAC;KACH;;kHAjBU,qBAAqB;mHAArB,qBAAqB,iBAVjB,wBAAwB,aAE7B,wBAAwB;mHAQvB,qBAAqB,aAPrB;QACT;YACE,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,kBAAkB;SAC7B;KACF,YAPQ,EAAE;2FASA,qBAAqB;kBAXjC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,YAAY;4BACrB,QAAQ,EAAE,kBAAkB;yBAC7B;qBACF;iBACF;;;AC9BD;;;;ACAA;;;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { BrowserOptions } from '@sentry/browser';
|
|
3
|
+
import { SentryErrorHandler } from './shared/errorhandler/sentry-error.handler';
|
|
3
4
|
import { Configurations } from './configuration';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
import * as i1 from "./vc-error-handlers.component";
|
|
6
7
|
export declare const FOR_ROOT_SENTRY_OPTIONS_TOKEN: InjectionToken<BrowserOptions>;
|
|
7
|
-
export declare function sentryInit(): void;
|
|
8
|
+
export declare function sentryInit(SentryErrorHandler: SentryErrorHandler): void;
|
|
8
9
|
export declare class VcErrorHandlersModule {
|
|
9
10
|
static forRoot(environmentConfig: Configurations): ModuleWithProviders<VcErrorHandlersModule>;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<VcErrorHandlersModule, never>;
|
package/package.json
CHANGED