25
									
								
								src/errors/ScanStationErrors.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/errors/ScanStationErrors.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| import { IsString } from 'class-validator'; | ||||
| import { NotAcceptableError, NotFoundError } from 'routing-controllers'; | ||||
|  | ||||
| /** | ||||
|  * Error to throw, when a non-existant scan station get's loaded. | ||||
|  */ | ||||
| export class ScanStationNotFoundError extends NotFoundError { | ||||
| 	@IsString() | ||||
| 	name = "ScanStationNotFoundError" | ||||
|  | ||||
| 	@IsString() | ||||
| 	message = "The scan station you provided couldn't be located in the system. \n Please check your request." | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Error to throw when two scan stations' ids don't match. | ||||
|  * Usually occurs when a user tries to change a scan station's id. | ||||
|  */ | ||||
| export class ScanStationIdsNotMatchingError extends NotAcceptableError { | ||||
| 	@IsString() | ||||
| 	name = "ScanStationIdsNotMatchingError" | ||||
|  | ||||
| 	@IsString() | ||||
| 	message = "The ids don't match! \n And if you wanted to change a scan station's id: This isn't allowed!" | ||||
| } | ||||
		Reference in New Issue
	
	Block a user