Add messaging module
This commit is contained in:
		
							parent
							
								
									0458e11267
								
							
						
					
					
						commit
						49af0811f1
					
				
					 1 changed files with 18 additions and 0 deletions
				
			
		
							
								
								
									
										18
									
								
								scripts/utilities/messaging.JS
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								scripts/utilities/messaging.JS
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| const CustomErrors = require(`./errors.JS`); | ||||
| 
 | ||||
| class Messaging { | ||||
|     /*  | ||||
|     Return an error message.  | ||||
| 
 | ||||
|     @param {object} INSTANCE - The response instance | ||||
|     @param {object} ERROR - The error object | ||||
|     */ | ||||
|     static exception (INSTANCE, ERROR) { | ||||
|         let MESSAGE = {error: ERROR}; | ||||
|         INSTANCE.json(MESSAGE); | ||||
|         console.error(ERROR); | ||||
|         return (MESSAGE); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| module.exports = Messaging; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue