Skip to content

Code coupling: AccessDeniedError and ApiError #3

@tshemsedinov

Description

@tshemsedinov

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:

  1. API can be accessed via different protocols
  2. Applied and transport errors (as a code at all) should be separated
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions