Skip to content

Commit

Permalink
Format exception name to cameCase
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored Feb 16, 2024
1 parent 70010f2 commit 9fe85dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/RecordBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,16 @@ public function withNote(?string $note): static
}


public function withError(?Throwable $e): static
public function withError(?Throwable $exception): static
{
if (!$e instanceof Throwable) {
if (!$exception instanceof Throwable) {
return $this;
}

$this->record['note'] = Format::className($e).': '.$e->getMessage();
$className = Format::className($exception);
$className = Format::camelCase($className);

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

Expand Down

0 comments on commit 9fe85dc

Please sign in to comment.