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."
|
||||
}
|
||||
18
src/errors/GroupContactErrors.ts
Normal file
18
src/errors/GroupContactErrors.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class GroupContactWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "GroupContactWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The groupContact must be either a existing groupContact, new groupContact or a existing adress's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
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."
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class ParticipantAddressWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "ParticipantAddressWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The participant's 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 ParticipantAddressNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "ParticipantAddressNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The address you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
@@ -48,4 +48,12 @@ export class RunnerOrganisationHasTeamsError extends NotAcceptableError {
|
||||
|
||||
@IsString()
|
||||
message = "This organisation still has teams associated with it. \n If you want to delete this organisation with all it's runners and teams ass `?force` to your query."
|
||||
}
|
||||
}
|
||||
|
||||
export class RunnerOrganisationWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerOrganisationWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The runner organisation must be either a existing organisation, new organisation or a existing organisation's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
@@ -36,4 +36,16 @@ export class RunnerTeamHasRunnersError extends NotAcceptableError {
|
||||
|
||||
@IsString()
|
||||
message = "This team still has runners associated with it. \n If you want to delete this team with all it's runners and teams ass `?force` to your query."
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to throw when a team still has runners associated.
|
||||
* Implemented this waysto work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerTeamNeedsParentError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerTeamNeedsParentError"
|
||||
|
||||
@IsString()
|
||||
message = "You provided no runner organisation as this team's parent group."
|
||||
}
|
||||
Reference in New Issue
Block a user