Skip to content

Commit

Permalink
refactor: Remove attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Dec 21, 2023
1 parent 6243002 commit 96d0eb4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/qibocal/auto/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ def update_platform(self, platform: Platform, update: bool):
def validate(self) -> TaskId:
"""Check status of completed and handle Failure using handler."""
if isinstance(self.status, Failure):
try:
return self.task.action.handler.id
except AttributeError:
log.error(
"Stopping execution because of error in validation without handler"
)
return None
handler = self.task.action.handler
if handler is not None:
return handler.id
log.error(
"Stopping execution because of error in validation without handler"
)
return None
return self.task.id

0 comments on commit 96d0eb4

Please sign in to comment.