22
33namespace Lanin \Laravel \ApiExceptions ;
44
5- use Exception ;
5+ use Throwable ;
66use Illuminate \Auth \Access \AuthorizationException ;
77use Illuminate \Auth \AuthenticationException ;
88use Illuminate \Database \Eloquent \ModelNotFoundException ;
@@ -16,11 +16,11 @@ trait ExceptionHandlerTrait
1616 * Report or log an exception.
1717 * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
1818 *
19- * @param \Exception $e
19+ * @param Throwable $e
2020 * @return void
2121 * @throws Exception
2222 */
23- public function report (Exception $ e )
23+ public function report (Throwable $ e )
2424 {
2525 parent ::report ($ e instanceof ApiException ? $ e ->toReport () : $ e );
2626 }
@@ -29,10 +29,10 @@ public function report(Exception $e)
2929 * Render an exception into an HTTP response.
3030 *
3131 * @param \Illuminate\Http\Request $request
32- * @param \Exception $e
32+ * @param Throwable $e
3333 * @return \Illuminate\Http\Response
3434 */
35- public function render ($ request , Exception $ e )
35+ public function render ($ request , Throwable $ e )
3636 {
3737 $ e = $ this ->resolveException ($ e );
3838
@@ -44,10 +44,10 @@ public function render($request, Exception $e)
4444 /**
4545 * Define exception.
4646 *
47- * @param Exception $e
47+ * @param Throwable $e
4848 * @return ApiException
4949 */
50- protected function resolveException (Exception $ e )
50+ protected function resolveException (Throwable $ e )
5151 {
5252 switch (true ) {
5353 case $ e instanceof ApiException:
0 commit comments