Skip to content

Commit

Permalink
dont override exception templateName & lineNumber when provided
Browse files Browse the repository at this point in the history
  • Loading branch information
cappuc committed Feb 1, 2024
1 parent 883cb23 commit b668772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Parse/ParseContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function handleError(Throwable $error): void
default => new InternalException($error),
};

$error->lineNumber = $this->lineNumber;
$error->lineNumber = $error->lineNumber ?? $this->lineNumber;

throw $error;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Render/RenderContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ public function handleError(Throwable $error, ?int $lineNumber = null): string
default => new InternalException($error),
};

$error->lineNumber = $lineNumber;
$error->templateName = $this->templateName;
$error->lineNumber = $error->lineNumber ?? $lineNumber;
$error->templateName = $error->templateName ?? $this->templateName;

$this->sharedState->errors[] = $error;

Expand Down

0 comments on commit b668772

Please sign in to comment.