Fixed messages and comments for TrackErrors + spelling for some other errors

ref #39
This commit is contained in:
2020-12-20 18:48:59 +01:00
parent 389f6347c3
commit 75b6489f8d
4 changed files with 6 additions and 8 deletions

View File

@@ -1,9 +1,8 @@
import { JsonController, Param, Body, Get, Post, Put, Delete, NotFoundError, OnUndefined, NotAcceptableError } from 'routing-controllers';
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
import { IsString } from 'class-validator';
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
/**
* 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()
@@ -16,12 +15,11 @@ export class TrackNotFoundError extends NotFoundError {
/**
* 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 = "TrackIdsNotMatchingError"
@IsString()
message = "The id's don't match!! \n And if you wanted to change a track's id: This isn't allowed"
message = "The ids don't match! \n And if you wanted to change a track's id: This isn't allowed"
}