We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0684f44 commit a457e00Copy full SHA for a457e00
src/ApiExceptionHandler.php
@@ -81,7 +81,13 @@ private function prepareApiExceptionData(Throwable $exception): array
81
} else {
82
$responseData['message'] = config('api-responses.unknown_error');
83
}
84
- $responseData['statusCode'] = ($exception instanceof HttpExceptionInterface) ? $exception->getStatusCode() : 500;
+
85
+ $responseData['statusCode'] = 500;
86
87
+ // If debug mode is enabled, add debug data to response
88
+ if (config('api-responses.debug_mode')) {
89
+ $responseData['debug'] = $this->extractExceptionData($exception);
90
+ }
91
92
93
return $responseData;
0 commit comments