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