Make error messages more verbose
This commit is contained in:
		
							parent
							
								
									e526a60bfd
								
							
						
					
					
						commit
						5d88fb9acb
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -8,9 +8,11 @@ class Messaging { | ||||||
|     @param {object} ERROR - The error object |     @param {object} ERROR - The error object | ||||||
|     */ |     */ | ||||||
|     static exception (INSTANCE, ERROR) { |     static exception (INSTANCE, ERROR) { | ||||||
|         let MESSAGE = {error: ERROR}; |         let MESSAGE = {"error": {}}; | ||||||
|         INSTANCE.json(MESSAGE); |         [`name`, `message`, `stack`].forEach((KEY) => { | ||||||
|         console.error(ERROR); |             MESSAGE[`error`][KEY] = ERROR[KEY]; | ||||||
|  |         }) | ||||||
|  |         INSTANCE.json(MESSAGE); console.error(ERROR); | ||||||
|         return (MESSAGE); |         return (MESSAGE); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue