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