Multi client/server: log fewer exceptions
This commit is contained in:
		
							parent
							
								
									ec1b9eca43
								
							
						
					
					
						commit
						04f5f2fa84
					
				| 
						 | 
					@ -410,7 +410,7 @@ async def snes_recv_loop(ctx : Context):
 | 
				
			||||||
        print("Snes disconnected, type /snes to reconnect")
 | 
					        print("Snes disconnected, type /snes to reconnect")
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print("Lost connection to the snes, type /snes to reconnect")
 | 
					        print("Lost connection to the snes, type /snes to reconnect")
 | 
				
			||||||
        if type(e) is not websockets.ConnectionClosed:
 | 
					        if not isinstance(e, websockets.WebSocketException):
 | 
				
			||||||
            logging.exception(e)
 | 
					            logging.exception(e)
 | 
				
			||||||
    finally:
 | 
					    finally:
 | 
				
			||||||
        socket, ctx.snes_socket = ctx.snes_socket, None
 | 
					        socket, ctx.snes_socket = ctx.snes_socket, None
 | 
				
			||||||
| 
						 | 
					@ -561,7 +561,7 @@ async def server_loop(ctx : Context):
 | 
				
			||||||
        print('Failed to connect to the multiworld server')
 | 
					        print('Failed to connect to the multiworld server')
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print('Lost connection to the multiworld server, type /connect to reconnect')
 | 
					        print('Lost connection to the multiworld server, type /connect to reconnect')
 | 
				
			||||||
        if type(e) is not websockets.ConnectionClosed:
 | 
					        if not isinstance(e, websockets.WebSocketException):
 | 
				
			||||||
            logging.exception(e)
 | 
					            logging.exception(e)
 | 
				
			||||||
    finally:
 | 
					    finally:
 | 
				
			||||||
        ctx.name = None
 | 
					        ctx.name = None
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,7 +102,7 @@ async def server(websocket, path, ctx : Context):
 | 
				
			||||||
                    args = msg[1]
 | 
					                    args = msg[1]
 | 
				
			||||||
                await process_client_cmd(ctx, client, cmd, args)
 | 
					                await process_client_cmd(ctx, client, cmd, args)
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        if type(e) is not websockets.ConnectionClosed:
 | 
					        if not isinstance(e, websockets.WebSocketException):
 | 
				
			||||||
            logging.exception(e)
 | 
					            logging.exception(e)
 | 
				
			||||||
    finally:
 | 
					    finally:
 | 
				
			||||||
        await on_client_disconnected(ctx, client)
 | 
					        await on_client_disconnected(ctx, client)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue