From 8741b2e2724fabb25465c06c3a4f881d9aa28d67 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 18 Mar 2024 20:26:31 +0100 Subject: src: change generic exception types to be more explicit Replace exception types to be more explicit about the nature of the error. Improve the exception raising semantics by using the 'from' keyword, this wraps an older exception into a new one so it is still considered the same object. --- src/virtual/qmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/virtual/qmp.py') diff --git a/src/virtual/qmp.py b/src/virtual/qmp.py index 5c8cf6a..96823d3 100644 --- a/src/virtual/qmp.py +++ b/src/virtual/qmp.py @@ -170,7 +170,7 @@ class QEMUMonitorProtocol(object): except socket.error as err: if err[0] == errno.EPIPE: return - raise socket.error(err) + raise socket.error(err) from err resp = self.__json_read() self.logger.debug("<<< %s", resp) return resp -- cgit v1.2.3-18-g5258