test: add authorize 100% coverage
This commit is contained in:
16
src/UnauthorizedError.ts
Normal file
16
src/UnauthorizedError.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export class UnauthorizedError extends Error {
|
||||
public inner: { message: string }
|
||||
public data: { message: string, code: string, type: 'UnauthorizedError' }
|
||||
|
||||
constructor (code: string, error: { message: string }) {
|
||||
super(error.message)
|
||||
this.message = error.message
|
||||
this.inner = error
|
||||
this.data = {
|
||||
message: this.message,
|
||||
code,
|
||||
type: 'UnauthorizedError'
|
||||
}
|
||||
Object.setPrototypeOf(this, UnauthorizedError.prototype)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user