Improved error handling for negative lap times

ref #71
This commit is contained in:
2021-01-03 17:21:53 +01:00
parent dcb791c9a2
commit 28c1b6d31d
5 changed files with 24 additions and 5 deletions

View File

@@ -22,4 +22,15 @@ export class TrackIdsNotMatchingError extends NotAcceptableError {
@IsString()
message = "The ids don't match! \n And if you wanted to change a track's id: This isn't allowed"
}
/**
* Error to throw when a track's lap time is set to a negative value.
*/
export class TrackLapTimeCantBeNegativeError extends NotAcceptableError {
@IsString()
name = "TrackLapTimeCantBeNegativeError"
@IsString()
message = "The minimum lap time you provided is negative - That isn't possible. \n If you wanted to disable it: Just set it to 0/null."
}