Skip to content

Commit

Permalink
Ref: moving UI update outta try block.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed Oct 19, 2023
1 parent 54a10ff commit d9afd1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions octoprint_octorelay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ def handle_update_command(self, index: str, target: Optional[bool] = None) -> bo
raise HandlingException(400)
try:
state = self.toggle_relay(index, target) # can raise an Exception if relay is disabled
self.update_ui()
return state
except Exception as exception:
raise HandlingException(404) from exception
self.update_ui()
return state

def handle_cancel_task_command(self, subject: str, target: bool, owner: str) -> bool:
self._logger.debug(f"Cancelling tasks from {owner} to switch the relay {subject} {'ON' if target else 'OFF'}")
Expand Down

0 comments on commit d9afd1b

Please sign in to comment.