TSK-931 structure for global Error handler
This commit is contained in:
parent
092b3a3cc9
commit
bbfdd53e2e
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue