Skip to content

Commit

Permalink
fix(Exceptions): Correct error message formatting
Browse files Browse the repository at this point in the history
- Adjusted the error message formatting in the ValidationException handler.
- Added a newline before the error list to improve readability.
- Ensured that each error message is prefixed with a hyphen for clarity.
  • Loading branch information
[email protected] committed Sep 30, 2024
1 parent 012e870 commit b0c2833
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function register(): void
{
$this->map(ValidationException::class, function (ValidationException $validationException) {
return (function (): ValidationException {
$this->message = ($prefix = '- ').implode(PHP_EOL.$prefix, $this->validator->errors()->all());
$this->message = PHP_EOL.($prefix = '- ').implode(PHP_EOL.$prefix, $this->validator->errors()->all());

/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this;
Expand Down

0 comments on commit b0c2833

Please sign in to comment.