mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fix the unhandled rejection logging to lock stack trace
This commit is contained in:
		
							parent
							
								
									1c733fbfab
								
							
						
					
					
						commit
						18d23af01a
					
				
							
								
								
									
										8
									
								
								bin/www
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								bin/www
									
									
									
									
									
								
							@ -1,12 +1,12 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
process.on('unhandledRejection', (reason, p) => {
 | 
			
		||||
    const message = 'Unhandled Rejection at: Promise' + p + ', reason:' + reason;
 | 
			
		||||
process.on('unhandledRejection', error => {
 | 
			
		||||
    // this makes sure that stacktrace of failed promise is printed out
 | 
			
		||||
    console.log(message);
 | 
			
		||||
    console.log(error);
 | 
			
		||||
 | 
			
		||||
    // but also try to log it into file
 | 
			
		||||
    require('../services/log').error(message);
 | 
			
		||||
    // we're using .info() instead of .error() because simple-node-logger emits weird error for error()
 | 
			
		||||
    require('../services/log').info(error);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const app = require('../app');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user