TSK-931 structure for global Error handler

This commit is contained in:
Finn Mißfeldt 2020-02-28 11:55:30 +01:00
parent 092b3a3cc9
commit bbfdd53e2e
4 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
import { Page } from 'app/models/page';
import { OrientationService } from 'app/services/orientation/orientation.service';
import { Orientation } from 'app/models/orientation';
import { ALERT_TYPES, ERROR_TYPES } from '../../../../services/general-modal/errors';
import { ERROR_TYPES } from '../../../../services/general-modal/errors';
export enum Side {
LEFT,

View File

@ -8,7 +8,7 @@ export class ErrorModel {
constructor(key: ERROR_TYPES, passedError?: ErrorHandler, addition?: string) {
this.head = errors.get(key).name;
this.body = errors.get(key).text
this.body = errors.get(key).text;
if (addition) {
this.body.replace('{rep}', addition);
}

View File

@ -14,8 +14,8 @@ export class ErrorsService {
this.errorSubject$.next(errorToShow);
}
public updateError(key: ERROR_TYPES, passedError?: ErrorHandler): void {
const errorModel = new ErrorModel(key, passedError);
public updateError(key: ERROR_TYPES, passedError?: ErrorHandler, addition?: string): void {
const errorModel = new ErrorModel(key, passedError, addition);
this.updateErrorSubject(errorModel);
}
}

View File

@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
import { AlertService } from 'app/services/alert/alert.service';
import { AlertModel, AlertType } from 'app/models/alert';
import { AccessIdsService } from 'app/shared/services/access-ids/access-ids.service';
import { ALERT_TYPES } from '../../../services/general-modal/errors';
import { ERROR_TYPES } from '../../../services/general-modal/errors';
@Injectable()
export class FormsValidatorService {