Created
March 19, 2014 21:46
-
-
Save m-maranan/9652089 to your computer and use it in GitHub Desktop.
Error And Exception Example
This file contains hidden or 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
| // this is how we catch the Runtime Exception | |
| // file : error.php | |
| App::error(function(RuntimeException $exception) | |
| { | |
| // Runtime Errors | |
| return "Runtime Error : ". $exception->getMessage(); | |
| }); | |
| // Example of Error Message | |
| // file: RegistrationController. | |
| Route::get('test',function(){ | |
| App::abort(403, 'The Email you provided is already registered'); | |
| }); | |
| // The Code Above Outputs | |
| Runtime Error : The Email you provided is already registered |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment