Skip to content

Commit 3679264

Browse files
authored
Update ApiExceptionHandler.php
1 parent f2bae2f commit 3679264

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: src/Handlers/ApiExceptionHandler.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ public function render($request, Throwable $e)
7777

7878
}
7979
// When Debug is on move show error here
80-
$response['trace'] = $e->getTrace();
81-
$response['code'] = $e->getCode();
80+
$message = null;
8281

83-
return ApiResponse::exception(new ApiException(null, null, 500, 500, null, $response));
82+
if($debug){
83+
$response['trace'] = $e->getTrace();
84+
$response['code'] = $e->getCode();
85+
$message = $e->getMessage();
86+
}
87+
88+
return ApiResponse::exception(new ApiException($message, null, 500, 500, null, $response));
8489
}
8590

8691
return parent::render($request, $e);

0 commit comments

Comments
 (0)