2
2
3
3
namespace App \Exceptions ;
4
4
5
- use Exception ;
5
+ use Throwable ;
6
6
use Illuminate \Http \Response ;
7
7
use Illuminate \Foundation \Exceptions \Handler as ExceptionHandler ;
8
8
use Illuminate \Database \Eloquent \ModelNotFoundException as ModelNotFoundException ;
@@ -33,10 +33,10 @@ class Handler extends ExceptionHandler
33
33
/**
34
34
* Report or log an exception.
35
35
*
36
- * @param \Exception $exception
36
+ * @param \Throwable $exception
37
37
* @return void
38
38
*/
39
- public function report (Exception $ exception )
39
+ public function report (Throwable $ exception )
40
40
{
41
41
parent ::report ($ exception );
42
42
}
@@ -45,10 +45,10 @@ public function report(Exception $exception)
45
45
* Render an exception into an HTTP response.
46
46
*
47
47
* @param \Illuminate\Http\Request $request
48
- * @param \Exception $exception
48
+ * @param \Throwable $exception
49
49
* @return \Illuminate\Http\Response
50
50
*/
51
- public function render ($ request , Exception $ exception )
51
+ public function render ($ request , Throwable $ exception )
52
52
{
53
53
if ( $ request ->wantsJson () ) {
54
54
@@ -65,10 +65,10 @@ public function render($request, Exception $exception)
65
65
* Render an exception into an HTTP response.
66
66
*
67
67
* @param \Illuminate\Http\Request $request
68
- * @param \Exception $exception
68
+ * @param \Throwable $exception
69
69
* @return \Illuminate\Http\JsonResponse
70
70
*/
71
- private function handleApiException ($ request , Exception $ exception )
71
+ private function handleApiException ($ request , Throwable $ exception )
72
72
{
73
73
$ debug = [
74
74
'exception ' => get_class ($ exception ),
@@ -96,7 +96,7 @@ private function handleApiException($request, Exception $exception)
96
96
/**
97
97
* Set a specific response payload for commons http error codes
98
98
*
99
- * @param \Exception $exception
99
+ * @param \Throwable $exception
100
100
* @return \Illuminate\Http\JsonResponse
101
101
*/
102
102
private function customApiResponse ($ exception , $ debug )
0 commit comments