Merge branch 'dev' into feature/14-user-controllers
This commit is contained in:
52
src/errors/RunnerErrors.ts
Normal file
52
src/errors/RunnerErrors.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { JsonController, Param, Body, Get, Post, Put, Delete, NotFoundError, OnUndefined, NotAcceptableError } from 'routing-controllers';
|
||||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Error to throw when a runner couldn't be found.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "RunnerNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "Runner not found!"
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to throw when two runners' ids don't match.
|
||||
* Usually occurs when a user tries to change a runner's id.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerIdsNotMatchingError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerIdsNotMatchingError"
|
||||
|
||||
@IsString()
|
||||
message = "The id's don't match!! \n And if you wanted to change a runner's id: This isn't allowed"
|
||||
}
|
||||
|
||||
export class RunnerOnlyOneGroupAllowedError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerOnlyOneGroupAllowedError"
|
||||
|
||||
@IsString()
|
||||
message = "Runner's can only be part of one group (team or organisiation)! \n You provided an id for both."
|
||||
}
|
||||
|
||||
export class RunnerGroupNeededError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerGroupNeededError"
|
||||
|
||||
@IsString()
|
||||
message = "Runner's need to be part of one group (team or organisiation)! \n You provided neither."
|
||||
}
|
||||
|
||||
|
||||
export class RunnerGroupNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "RunnerGroupNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The group you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
27
src/errors/RunnerOrganisationErrors.ts
Normal file
27
src/errors/RunnerOrganisationErrors.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { JsonController, Param, Body, Get, Post, Put, Delete, NotFoundError, OnUndefined, NotAcceptableError } from 'routing-controllers';
|
||||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Error to throw when a runner couldn't be found.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerOrganisationNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "RunnerOrganisationNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "RunnerOrganisation not found!"
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to throw when two runners' ids don't match.
|
||||
* Usually occurs when a user tries to change a runner's id.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerOrganisationIdsNotMatchingError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerOrganisationIdsNotMatchingError"
|
||||
|
||||
@IsString()
|
||||
message = "The id's don't match!! \n And if you wanted to change a runner's id: This isn't allowed"
|
||||
}
|
||||
Reference in New Issue
Block a user