🚧 CreateUserErrors model

ref #14
This commit is contained in:
Philipp Dormann 2020-12-03 18:33:30 +01:00
parent d2c826c7c9
commit 983fa41cba
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import { NotFoundError } from 'routing-controllers';
import { IsString } from 'class-validator';
/**
* Error to throw when a usergroup couldn't be found.
*/
export class UserGroupNotFoundError extends NotFoundError {
@IsString()
name = "UserGroupNotFoundError"
@IsString()
message = "User Group not found!"
}
/**
* Error to throw when no username or email is set
*/
export class UsernameOrEmailNeededError extends NotFoundError {
@IsString()
name = "UsernameOrEmailNeededError"
@IsString()
message = "no username or email is set!"
}