mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Don't assume errors have stacks associated with them
This commit is contained in:
		
							
								
								
									
										18
									
								
								red.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								red.js
									
									
									
									
									
								
							| @@ -171,7 +171,11 @@ RED.start().then(function() { | ||||
|                 util.log('[red] Error: port in use'); | ||||
|             } else { | ||||
|                 util.log('[red] Uncaught Exception:'); | ||||
|                 util.log(err.stack); | ||||
|                 if (err.stack) { | ||||
|                     util.log(err.stack); | ||||
|                 } else { | ||||
|                     util.log(err); | ||||
|                 } | ||||
|             } | ||||
|             process.exit(1); | ||||
|         }); | ||||
| @@ -187,13 +191,21 @@ RED.start().then(function() { | ||||
|     } | ||||
| }).otherwise(function(err) { | ||||
|     util.log("[red] Failed to start server:"); | ||||
|     util.log(err.stack); | ||||
|     if (err.stack) { | ||||
|         util.log(err.stack); | ||||
|     } else { | ||||
|         util.log(err); | ||||
|     } | ||||
| }); | ||||
|  | ||||
|  | ||||
| process.on('uncaughtException',function(err) { | ||||
|     util.log('[red] Uncaught Exception:'); | ||||
|     util.log(err.stack); | ||||
|     if (err.stack) { | ||||
|         util.log(err.stack); | ||||
|     } else { | ||||
|         util.log(err); | ||||
|     } | ||||
|     process.exit(1); | ||||
| }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user