Add data errors
This commit is contained in:
		
							parent
							
								
									49af0811f1
								
							
						
					
					
						commit
						9151a88ce5
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		|  | @ -8,6 +8,21 @@ CustomErrors.URL = class URL_Error extends Error { | ||||||
|     }; |     }; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | CustomErrors.Data = class Data_Problem extends Error { | ||||||
|  |     constructor(message, data) { | ||||||
|  |         super(message); | ||||||
|  |         this.name = "Data-related Problem"; | ||||||
|  |         this.stack = data; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | CustomErrors.Data.Missing = class DataMissing_Problem extends CustomErrors.Data { | ||||||
|  |     constructor(data) { | ||||||
|  |         super("The required data is missing. The stack contains the received data."); | ||||||
|  |         this.name = `${this.name}: Missing Information`; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| CustomErrors.DBProblem = class DB_Error extends Error { | CustomErrors.DBProblem = class DB_Error extends Error { | ||||||
|     constructor(message) { |     constructor(message) { | ||||||
|         super(message); |         super(message); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue