lumen5.6でApp\Exceptions\Handler.phpが呼ばれません。
bootstrap/app.phpは以下のように設定されています。
/* |-------------------------------------------------------------------------- | Register Container Bindings |-------------------------------------------------------------------------- | | Now we will register a few bindings in the service container. We will | register the exception handler and the console kernel. You may add | your own bindings here if you like or you can make another file. | */ $app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, App\Exceptions\Handler::class );
エラー発生時の処理を変えたくてApp\Exceptions\Handler.phpを修正したのですが、呼ばれている気配がありません。
具体的には、以下のようにまずレンダリング処理をコメントアウトしています。
以下のソースでもダメだったので明らかにエラーになるコード(xxxxx)を埋め込んでみたのですが、
それでもエラーになりません。(相変わらずNotFoundHttpExceptionのみ)
/** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $e * @return \Illuminate\Http\Response */ public function render($request, Exception $e) { var_dump($e); // return parent::render($request, $e); }
ちなみに無理やりですが、vendor/laravel/lumen/app/Exceptions/Handler.php
のrenderメソッドに行った修正は反映されました。
この環境はroute.phpからControllerファイルも呼べていないので環境がおかしいのかもしれないのですが、
何かわかる方がいれば教えてください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。