Last active
September 5, 2015 05:20
-
-
Save sword-jin/cbb644bc43cac0df5efc to your computer and use it in GitHub Desktop.
修改 default page
在handle.php 中重写 convertExceptionToResponse 方法
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
| <?php namespace App\Exceptions; | |
| use Exception; | |
| use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | |
| use Symfony\Component\Debug\ExceptionHandler as SymfonyDisplayer; | |
| class Handler extend ExceptionHandler | |
| { | |
| /** | |
| * Convert the given exception into a Response instance. | |
| * | |
| * @param \Exception $e | |
| * | |
| * @return \Symfony\Component\HttpFoundation\Response | |
| */ | |
| protected function convertExceptionToResponse(Exception $e) | |
| { | |
| $debug = config('app.debug', false); | |
| if ($debug) { | |
| return (new SymfonyDisplayer($debug))->createResponse($e); | |
| } | |
| return response()->view('errors.default', ['expection' => $e], 500); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment