mirror of
				https://github.com/Lissy93/dashy.git
				synced 2025-10-31 19:33:58 +01:00 
			
		
		
		
	⚡ Adds second param to ErrorHandler for printing stack trace
This commit is contained in:
		
							parent
							
								
									9915100c13
								
							
						
					
					
						commit
						e8fa255e2e
					
				| @ -22,10 +22,15 @@ const appendToErrorLog = (msg) => { | |||||||
|  * If error reporting is enabled, will also log the message to Sentry |  * If error reporting is enabled, will also log the message to Sentry | ||||||
|  * If you wish to use your own error logging service, put code for it here |  * If you wish to use your own error logging service, put code for it here | ||||||
|  */ |  */ | ||||||
| const ErrorHandler = function handler(msg) { | const ErrorHandler = function handler(msg, errorStack) { | ||||||
|   warningMsg(msg); // Print to console
 |   // Print to console
 | ||||||
|   appendToErrorLog(msg); // Save to local storage
 |   warningMsg(msg); | ||||||
|   Sentry.captureMessage(`[USER-WARN] ${msg}`); // Report to bug tracker (if enabled)
 |   // If stack trace included, then print that too
 | ||||||
|  |   if (errorStack) console.warn(errorStack); // eslint-disable-line no-console
 | ||||||
|  |   // Save to local storage
 | ||||||
|  |   appendToErrorLog(msg); | ||||||
|  |   // Report to bug tracker (if enabled)
 | ||||||
|  |   Sentry.captureMessage(`[USER-WARN] ${msg}`); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| /* Similar to error handler, but for recording general info */ | /* Similar to error handler, but for recording general info */ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user