feat(admin): add more details for admin errors

This commit is contained in:
2025-12-04 11:25:02 +03:00
parent 8f6af04e73
commit 17865d8af4

View File

@@ -136,7 +136,10 @@ class ControllerExtensionModuleTgshop extends Controller
http_response_code(HttpResponse::HTTP_INTERNAL_SERVER_ERROR);
header('Content-Type: application/json');
echo json_encode([
'error' => getenv('APP_DEBUG') ? $e->getMessage() : 'Server Error.',
'error' => $e->getMessage(),
'code' => $e->getCode(),
'file' => $e->getFile(),
'line' => $e->getLine(),
], JSON_THROW_ON_ERROR);
}
}