api: do not fail events when listener is cancelled in the meantime
Raising any error from event handler will abort further handlers of this event.
This commit is contained in:
		
							parent
							
								
									a3f542edcd
								
							
						
					
					
						commit
						8c1ba905a0
					
				@ -325,6 +325,8 @@ class QubesDaemonProtocol(asyncio.Protocol):
 | 
				
			|||||||
            self.transport.write(content.encode('utf-8'))
 | 
					            self.transport.write(content.encode('utf-8'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def send_event(self, subject, event, **kwargs):
 | 
					    def send_event(self, subject, event, **kwargs):
 | 
				
			||||||
 | 
					        if self.transport is None:
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
        self.event_sent = True
 | 
					        self.event_sent = True
 | 
				
			||||||
        self.send_header(0x31)
 | 
					        self.send_header(0x31)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user