Pārlūkot izejas kodu

Improve error messaging

shalvah 3 gadi atpakaļ
vecāks
revīzija
8b3e06b98a

+ 1 - 1
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
         );
     }

+ 1 - 1
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);
     }
 }