Closed 2franix closed 9 months ago
@Mic92 Can you please let me know what you think of this PR?
@mergify queue
queue
Thanks @Mic92! I saw the tests are failing. That does not look related to my changes but I can take a look if you want.
Otherwise, I am waiting for a new version to be available to fix a bug in Home Assistant. So I am happy to help on anything that speeds up the process. Just let me know!
Fixes #220 (see issue for details about the problem fixed here).
The fix consists in iterating over all commands still in the queue while we are running the generic exception handler, and pass each of them the exception being handled by calling their
_feed_error()
method.With the fix, the output of the minimal script reproducing the issue is:
Pay attention to the beginning of the output as there are now the two lines we expect:
showing that the client now receives the error.
The remainder of the output comes from the
MPDClient.__idle_result()
method hooked as "done callback" of the current future. It accessesresult.result()
which causes the exception to be raised again. This is most likely harmless and has nothing to do with the issue being fixed.