Commit 91c91a6a authored by Christopher Fullarton's avatar Christopher Fullarton

Adds the sentry dsn as environment parameter and does not initialize the...

Adds the sentry dsn as environment parameter and does not initialize the connection if no dsn is provided
parent 5747db9c
......@@ -2,6 +2,7 @@ import { LoginMechanism } from '../enums/enums';
import { QuizTheme } from '../enums/QuizTheme';
export interface IEnvironment {
sentryDSN?: string;
version: string;
claimSrc?: string;
production: boolean;
......
......@@ -4,12 +4,15 @@ import { environment } from '../../environments/environment';
@Injectable({ providedIn: 'root' })
export class SentryErrorHandler implements ErrorHandler {
private readonly _enabled = environment.production && !['localhost', '127.0.0.1'].includes(location.hostname);
private readonly _enabled = environment.production && environment.sentryDSN && !['localhost', '127.0.0.1'].includes(location.hostname);
constructor() {
if (!environment.sentryDSN) {
return;
}
SentryInit({
dsn: 'https://f16c02fdefe64c018f5d580d1cf05b56@sentry.io/1819496',
dsn: environment.sentryDSN,
enabled: this._enabled,
release: environment.version,
});
......
......@@ -5,6 +5,7 @@ import { IEnvironment } from '../app/lib/interfaces/IEnvironment';
export const environment: IEnvironment = {
production: true,
version: 'VERSION',
sentryDSN: 'https://f16c02fdefe64c018f5d580d1cf05b56@sentry.io/1819496',
ssrEndpoint: 'https://staging.arsnova.click/backend',
serverEndpoint: 'https://staging.arsnova.click/backend',
httpApiEndpoint: 'https://staging.arsnova.click/backend/api/v1',
......
......@@ -5,6 +5,7 @@ import { IEnvironment } from '../app/lib/interfaces/IEnvironment';
export const environment: IEnvironment = {
production: true,
version: 'VERSION',
sentryDSN: 'https://f16c02fdefe64c018f5d580d1cf05b56@sentry.io/1819496',
ssrEndpoint: 'https://beta.arsnova.click/backend',
serverEndpoint: 'https://beta.arsnova.click/backend',
httpApiEndpoint: 'https://beta.arsnova.click/backend/api/v1',
......
......@@ -5,6 +5,7 @@ import { IEnvironment } from '../app/lib/interfaces/IEnvironment';
export const environment: IEnvironment = {
production: true,
version: 'VERSION',
sentryDSN: 'https://f16c02fdefe64c018f5d580d1cf05b56@sentry.io/1819496',
ssrEndpoint: 'https://staging.arsnova.click/backend',
serverEndpoint: 'https://staging.arsnova.click/backend',
httpApiEndpoint: 'https://staging.arsnova.click/backend/api/v1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment