-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improves validateUserByPayload logic
- Loading branch information
Showing
7 changed files
with
68 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './not-found-ip.exception'; | ||
export * from './not-found-token.exception'; | ||
export * from './not-found-user.exception'; |
11 changes: 11 additions & 0 deletions
11
packages/leaa-api/src/exceptions/not-found-token.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { HttpException, HttpStatus } from '@nestjs/common'; | ||
|
||
export class NotFoundTokenException extends HttpException { | ||
/** | ||
* @param objectOrError string or object describing the error condition. | ||
* @param description a short description of the HTTP error. | ||
*/ | ||
constructor(objectOrError?: string | object | any, description = 'Not Found Token') { | ||
super(HttpException.createBody(objectOrError, description, HttpStatus.NOT_FOUND), HttpStatus.NOT_FOUND); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/leaa-api/src/exceptions/not-found-user.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { HttpException, HttpStatus } from '@nestjs/common'; | ||
|
||
export class NotFoundUserException extends HttpException { | ||
/** | ||
* @param objectOrError string or object describing the error condition. | ||
* @param description a short description of the HTTP error. | ||
*/ | ||
constructor(objectOrError?: string | object | any, description = 'Not Found User') { | ||
super(HttpException.createBody(objectOrError, description, HttpStatus.NOT_FOUND), HttpStatus.NOT_FOUND); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters