Skip to content

Commit

Permalink
cleaning exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
meguiraun authored and marcus-oscarsson committed Sep 27, 2023
1 parent fa6c1c3 commit dcb94ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mxcube3/core/adapter/adapter_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ def _command_success(self, t):
logging.getLogger("MX3.HWR").info(
f"{self._name}.{cmd_name} returned {value}"
)
self._msg = value
if value:
self._msg = value
self.app.server.emit(
"hardware_object_command_return",
{"cmd_name": cmd_name, "value": value},
namespace="/hwr",
)

self.emit_ho_changed()
self.emit_ho_changed(self.state())

def _command_exception(self, cmd_name, ex):
self._msg = traceback.format_exc()
Expand All @@ -114,7 +115,7 @@ def _command_exception(self, cmd_name, ex):
{"cmd_name": cmd_name, "value": str(ex)},
namespace="/hwr",
)
self.emit_ho_changed()
self.emit_ho_changed(self.state())

@property
def adapter_type(self):
Expand Down Expand Up @@ -320,7 +321,6 @@ def _dict_repr(self):
logging.getLogger("MX3.HWR").exception(
f"Failed to get dictionary representation of {self._name}"
)

return data

def data(self):
Expand Down

0 comments on commit dcb94ca

Please sign in to comment.