From: kaliko Date: Thu, 10 Feb 2022 16:17:49 +0000 (+0100) Subject: Catch uncaught socket.timeout (OSError subclass). X-Git-Tag: 0.18.2~5 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;ds=sidebyside;h=36db5e965f1e8dba54b42e31082709b914dd5194;hp=36db5e965f1e8dba54b42e31082709b914dd5194;p=mpd-sima.git Catch uncaught socket.timeout (OSError subclass). Wrap first call of MPD._reset_cache in try/catch, but I don't understand why... During first connection, player cache is populated with MPD._reset_cache Even though the connection to MPD succeed, we can receive a socket.timeout if the proxy is not reachable (MPD server in satellite mode request another MPD server for music library requests, for instance during _reset_cache). The issue here is the OSError (socket.timeout) is not raised as it should be, ie. wrapped in PlayerError within MPD.__getattr__. MPD._reset_cache is calling list('artist'), which is actually going through MPD.__getattr__, but when OSError is raised is is not wrapped in PlayerError. Launching mpd-sima against an MPD server on the same host but with a database proxy over the network can trigger this socket.timeout: * Start MPD * Shutdown internet link * Start mpd-sima ---