Files
backend/src/errors/CreateUserErrors.ts
2020-12-03 18:33:30 +01:00

25 lines
549 B
TypeScript

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!"
}