|
export class AccessDeniedError extends ApiError { |
|
constructor(message?: string, data?: ErrorData, processCode?: number, type?: ErrorType) { |
|
super(message || 'Forbidden', HttpStatusCode.FORBIDDEN, data, processCode, type) |
|
} |
|
} |
This abstractions should not know about HTTP status, headers and so on because:
- API can be accessed via different protocols
- Applied and transport errors (as a code at all) should be separated
- Class with no functionality
All code here is not needed at all: https://github.com/diia-open-source/be-pkg-errors/tree/main/src/errors
be-pkg-errors/src/errors/AccessDeniedError.ts
Lines 7 to 11 in 10af597
This abstractions should not know about HTTP status, headers and so on because:
All code here is not needed at all: https://github.com/diia-open-source/be-pkg-errors/tree/main/src/errors