Added basic runner related errors
This commit is contained in:
parent
18fdd367ac
commit
980ac64688
|
@ -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 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"
|
||||
}
|
Loading…
Reference in New Issue