25
src/errors/RunnerCardErrors.ts
Normal file
25
src/errors/RunnerCardErrors.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
/**
|
||||
* Error to throw when a card couldn't be found.
|
||||
*/
|
||||
export class RunnerCardNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "RunnerCardNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "Card not found!"
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to throw when two cards' ids don't match.
|
||||
* Usually occurs when a user tries to change a card's id.
|
||||
*/
|
||||
export class RunnerCardIdsNotMatchingError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerCardIdsNotMatchingError"
|
||||
|
||||
@IsString()
|
||||
message = "The ids don't match! \n And if you wanted to change a cards's id: This isn't allowed"
|
||||
}
|
||||
Reference in New Issue
Block a user