18
src/errors/AddressErrors.ts
Normal file
18
src/errors/AddressErrors.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class AddressWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "AddressWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The address must be either a existing address, new address or a existing adress's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
export class AddressNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "AddressNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The address you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
Reference in New Issue
Block a user