From 8b3e06b98a6a7d2088b533c603c11fad2e7d94b3 Mon Sep 17 00:00:00 2001 From: shalvah Date: Sat, 21 Aug 2021 09:45:21 +0100 Subject: [PATCH] Improve error messaging --- src/Exceptions/CouldntProcessValidationRule.php | 2 +- src/Exceptions/ProblemParsingValidationRules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exceptions/CouldntProcessValidationRule.php b/src/Exceptions/CouldntProcessValidationRule.php index 1ec9e475..7ad99bb1 100644 --- a/src/Exceptions/CouldntProcessValidationRule.php +++ b/src/Exceptions/CouldntProcessValidationRule.php @@ -9,7 +9,7 @@ class CouldntProcessValidationRule extends \RuntimeException implements ScribeEx public static function forParam(string $paramName, $rule, Throwable $innerException): CouldntProcessValidationRule { return new self( - "Couldn't process this validation rule for the param `$paramName`: ".var_export($rule, true), + "Couldn't process the validation rule ".var_export($rule, true)." for the param `$paramName`: {$innerException->getMessage()}", 0, $innerException ); } diff --git a/src/Exceptions/ProblemParsingValidationRules.php b/src/Exceptions/ProblemParsingValidationRules.php index a4e0eb2f..f8d64fba 100644 --- a/src/Exceptions/ProblemParsingValidationRules.php +++ b/src/Exceptions/ProblemParsingValidationRules.php @@ -9,7 +9,7 @@ class ProblemParsingValidationRules extends \RuntimeException implements ScribeE public static function forParam(string $paramName, Throwable $innerException): ProblemParsingValidationRules { return new self( - "Problem processing validation rules for the param `$paramName`", + "Problem processing validation rules for the param `$paramName`: {$innerException->getMessage()}", 0, $innerException); } }