瀏覽代碼

Improve error messaging

shalvah 3 年之前
父節點
當前提交
8b3e06b98a
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/Exceptions/CouldntProcessValidationRule.php
  2. 1 1
      src/Exceptions/ProblemParsingValidationRules.php

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