From 0a08a557f9e017cebabacbdb86877cb705f8ba79 Mon Sep 17 00:00:00 2001 From: William Moore Date: Thu, 22 Feb 2024 17:19:54 +0000 Subject: [PATCH 1/2] get strings from omero.cmd.ERR and omero.CmdError correctly --- omeroweb/webclient/webclient_gateway.py | 2 +- omeroweb/webgateway/marshal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/omeroweb/webclient/webclient_gateway.py b/omeroweb/webclient/webclient_gateway.py index 2d365e9ce1..11cce2930f 100644 --- a/omeroweb/webclient/webclient_gateway.py +++ b/omeroweb/webclient/webclient_gateway.py @@ -1591,7 +1591,7 @@ def updatePermissions(self, group, permissions): try: cb = self.c.submit(command, loops=120) except omero.CmdError as ex: - message = ex.err.message + message = str(ex.err) finally: if cb: cb.close(True) diff --git a/omeroweb/webgateway/marshal.py b/omeroweb/webgateway/marshal.py index 80008ea3c2..ac7863bb12 100644 --- a/omeroweb/webgateway/marshal.py +++ b/omeroweb/webgateway/marshal.py @@ -445,7 +445,7 @@ def graphResponseMarshal(conn, rsp): rv = {} if isinstance(rsp, omero.cmd.ERR): rsp_params = ", ".join(["%s: %s" % (k, v) for k, v in rsp.parameters.items()]) - rv["error"] = rsp.message + rv["error"] = str(rsp.category) rv["report"] = "%s %s" % (rsp.name, rsp_params) else: included = rsp.responses[0].includedObjects From d328a0cbb5b49cd63929a8a6c6cf7a89a925d005 Mon Sep 17 00:00:00 2001 From: William Moore Date: Wed, 6 Mar 2024 12:21:46 +0000 Subject: [PATCH 2/2] Use str(omero.CmdError) and str(omero.cmd.ERR.name) --- omeroweb/webclient/webclient_gateway.py | 2 +- omeroweb/webgateway/marshal.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/omeroweb/webclient/webclient_gateway.py b/omeroweb/webclient/webclient_gateway.py index 11cce2930f..fef0da14a8 100644 --- a/omeroweb/webclient/webclient_gateway.py +++ b/omeroweb/webclient/webclient_gateway.py @@ -1591,7 +1591,7 @@ def updatePermissions(self, group, permissions): try: cb = self.c.submit(command, loops=120) except omero.CmdError as ex: - message = str(ex.err) + message = str(ex) finally: if cb: cb.close(True) diff --git a/omeroweb/webgateway/marshal.py b/omeroweb/webgateway/marshal.py index ac7863bb12..002d57ccb0 100644 --- a/omeroweb/webgateway/marshal.py +++ b/omeroweb/webgateway/marshal.py @@ -445,8 +445,8 @@ def graphResponseMarshal(conn, rsp): rv = {} if isinstance(rsp, omero.cmd.ERR): rsp_params = ", ".join(["%s: %s" % (k, v) for k, v in rsp.parameters.items()]) - rv["error"] = str(rsp.category) - rv["report"] = "%s %s" % (rsp.name, rsp_params) + rv["error"] = str(rsp.name) + rv["report"] = rsp_params else: included = rsp.responses[0].includedObjects deleted = rsp.responses[0].deletedObjects