Skip to content

Commit

Permalink
Return / raise even if complete
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed May 15, 2024
1 parent de4efbf commit e0efa72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controlflow/core/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ def run(self, max_iterations: int = NOTSET) -> T:
)
self.run_once()
counter += 1
if self.is_successful():
return self.result
elif self.is_failed():
raise ValueError(f"{self.friendly_name()} failed: {self.error}")
if self.is_successful():
return self.result
elif self.is_failed():
raise ValueError(f"{self.friendly_name()} failed: {self.error}")

@contextmanager
def _context(self):
Expand Down

0 comments on commit e0efa72

Please sign in to comment.