소스 검색

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