@@ -1,6 +1,10 @@
|
||||
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 track couldn't be found.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class TrackNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "TrackNotFoundError"
|
||||
@@ -9,9 +13,14 @@ export class TrackNotFoundError extends NotFoundError {
|
||||
message = "Track not found!"
|
||||
}
|
||||
|
||||
export class TrackIdChangeNotAllowedError extends NotAcceptableError {
|
||||
/**
|
||||
* Error to throw when two tracks' ids don't match.
|
||||
* Usually occurs when a user tries to change a track's id.
|
||||
* Implemented this ways to work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class TrackIdsNotMatchingError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "TrackIdChangeNotAllowed"
|
||||
name = "TrackIdsNotMatchingError"
|
||||
|
||||
@IsString()
|
||||
message = "The id's don't match!! \n And if you wanted to change a track's id: This isn't allowed"
|
||||
|
||||
Reference in New Issue
Block a user