diff --git a/src/RecordBuilder.php b/src/RecordBuilder.php index 7f2eada..d2a6cdf 100644 --- a/src/RecordBuilder.php +++ b/src/RecordBuilder.php @@ -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; @@ -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; }