Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $validation_exception = null;
- ...
- if($thingThatShouldCauseException) {
- $validation_exception = new Exception('blah blah', 0, $validation_exception);
- }
- ...
- if($thingThatShouldCauseException) {
- $validation_exception = new Exception('blah blah', 0, $validation_exception);
- }
- ...
- if ($validation_exception !== null){
- throw $validation_exception;
- }
- ...
- }
- catch(Exception e){
- echo "\nError(s) encountered while processing file:\n";
- do{
- echo "\t".$e->getMessage()."\n";
- }while($e = $e->getPrevious());
- echo "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement