mirror of
				https://github.com/Klipper3d/klipper.git
				synced 2025-11-03 20:05:49 +01:00 
			
		
		
		
	motan: Improve handling of errors during data subscriptions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
		@@ -159,6 +159,10 @@ class DataLogger:
 | 
				
			|||||||
                                    {"sensor": aname})
 | 
					                                    {"sensor": aname})
 | 
				
			||||||
    def handle_dump(self, msg, raw_msg):
 | 
					    def handle_dump(self, msg, raw_msg):
 | 
				
			||||||
        msg_id = msg["id"]
 | 
					        msg_id = msg["id"]
 | 
				
			||||||
 | 
					        if "result" not in msg:
 | 
				
			||||||
 | 
					            self.error("Unable to subscribe to '%s': %s"
 | 
				
			||||||
 | 
					                       % (msg_id, msg.get("error", {}).get("message", "")))
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
        self.db.setdefault("subscriptions", {})[msg_id] = msg["result"]
 | 
					        self.db.setdefault("subscriptions", {})[msg_id] = msg["result"]
 | 
				
			||||||
    def flush_index(self):
 | 
					    def flush_index(self):
 | 
				
			||||||
        self.db['file_position'] = self.logger.flush()
 | 
					        self.db['file_position'] = self.logger.flush()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user