UserNotFoundError

ref #12
This commit is contained in:
Philipp Dormann 2020-12-04 23:02:23 +01:00
parent a5b1804e19
commit d803704eee
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { IsString } from 'class-validator';
import { ForbiddenError, NotAcceptableError, UnauthorizedError } from 'routing-controllers';
import { ForbiddenError, NotAcceptableError, NotFoundError, UnauthorizedError } from 'routing-controllers';
/**
* Error to throw when a jwt is expired
@ -65,4 +65,15 @@ export class PasswordNeededError extends NotAcceptableError {
@IsString()
message = "no password is provided - you need to provide it"
}
/**
* Error to thow when no user could be found for provided credential
*/
export class UserNotFoundError extends NotFoundError {
@IsString()
name = "UserNotFoundError"
@IsString()
message = "no user could be found for provided credential"
}