-
-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better error messaging for failed validation rule parsing
- Loading branch information
Showing
3 changed files
with
383 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Knuckles\Scribe\Exceptions; | ||
|
||
use Throwable; | ||
|
||
class CouldntProcessValidationRule extends \RuntimeException implements ScribeException | ||
{ | ||
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), | ||
0, $innerException | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Knuckles\Scribe\Exceptions; | ||
|
||
use Throwable; | ||
|
||
class ProblemParsingValidationRules extends \RuntimeException implements ScribeException | ||
{ | ||
public static function forParam(string $paramName, Throwable $innerException): ProblemParsingValidationRules | ||
{ | ||
return new self( | ||
"Problem processing validation rules for the param `$paramName`", | ||
0, $innerException); | ||
} | ||
} |
Oops, something went wrong.