Skip to content

Commit

Permalink
Set isFinished when using withError
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored Mar 13, 2024
1 parent 1c6f971 commit eb01ca4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RecordBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function withNote(?string $note): static
}


public function withError(?Throwable $exception): static
public function withError(?Throwable $exception, bool $isFinished = false): static
{
if (!$exception instanceof Throwable) {
return $this;
Expand All @@ -94,6 +94,7 @@ public function withError(?Throwable $exception): static
$className = ucfirst($className);

$this->record['note'] = $className.': '.$exception->getMessage();
$this->record['finished'] ??= $isFinished;
return $this;
}

Expand Down

0 comments on commit eb01ca4

Please sign in to comment.