mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	added try catch to socket calls
This commit is contained in:
		| @@ -162,10 +162,18 @@ Sockets.init = function() { | |||||||
| 					// Call the requested method | 					// Call the requested method | ||||||
| 					if (Namespaces[namespace].before) { | 					if (Namespaces[namespace].before) { | ||||||
| 						Namespaces[namespace].before(sessionData, function() { | 						Namespaces[namespace].before(sessionData, function() { | ||||||
| 							methodToCall.apply(Namespaces, socketArgs); | 							try { | ||||||
|  | 								methodToCall.apply(Namespaces, socketArgs); | ||||||
|  | 							} catch (e) { | ||||||
|  | 								winston.error(e.message); | ||||||
|  | 							} | ||||||
| 						}); | 						}); | ||||||
| 					} else { | 					} else { | ||||||
| 						methodToCall.apply(Namespaces, socketArgs); | 						try { | ||||||
|  | 							methodToCall.apply(Namespaces, socketArgs); | ||||||
|  | 						} catch (e) { | ||||||
|  | 							winston.error(e.message); | ||||||
|  | 						} | ||||||
| 					} | 					} | ||||||
| 					// winston.info('[socket.io] Executing: ' + payload.name); | 					// winston.info('[socket.io] Executing: ' + payload.name); | ||||||
| 				} else { | 				} else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user