Skip to content

Commit

Permalink
add UnauthenticatedError
Browse files Browse the repository at this point in the history
  • Loading branch information
tomimelo committed Dec 8, 2023
1 parent 62ae254 commit 9fafc9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/error/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ export class UnauthorizedError<DATA = unknown> extends MadError {
}
}

export class UnauthenticatedError<DATA = unknown> extends MadError {
public constructor (message: string, data?: DATA) {
super(message)
this.name = 'UnauthenticatedError'
this.code('UNAUTHENTICATED')
this.data(data)
this.status(401)
}
}

export class NotFoundError<DATA = unknown> extends MadError {
public constructor (message: string, data?: DATA) {
super(message)
Expand Down

0 comments on commit 9fafc9c

Please sign in to comment.