backend/src/errors/GroupContactErrors.ts
2021-01-10 16:07:37 +01:00

24 lines
768 B
TypeScript

import { IsString } from 'class-validator';
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
/**
* Error to throw, when a provided groupContact doesn't belong to the accepted types.
*/
export class GroupContactWrongTypeError extends NotAcceptableError {
@IsString()
name = "GroupContactWrongTypeError"
@IsString()
message = "The groupContact must be an existing groupContact's id. \n You provided a object of another type."
}
/**
* Error to throw, when a non-existent groupContact get's loaded.
*/
export class GroupContactNotFoundError extends NotFoundError {
@IsString()
name = "GroupContactNotFoundError"
@IsString()
message = "The groupContact you provided couldn't be located in the system. \n Please check your request."
}