Browse Source

Updated exception handling in http service presenter - fixed hardcoded error code

master
Jan Pavlíček 8 months ago
parent
commit
5d6f856b36
  1. 2
      lib/NetteUtils/Rest/HttpServicePresenter.php

2
lib/NetteUtils/Rest/HttpServicePresenter.php

@ -94,7 +94,7 @@ abstract class HttpServicePresenter extends Presenter
{ {
$this->response->setCode(IResponse::S500_INTERNAL_SERVER_ERROR); $this->response->setCode(IResponse::S500_INTERNAL_SERVER_ERROR);
$this->sendResponse(new JsonResponse(['fault' => [ $this->sendResponse(new JsonResponse(['fault' => [
'faultcode' => 500,
'faultcode' => $code,
'faultstring' => $exception->getMessage(), 'faultstring' => $exception->getMessage(),
'detail' => get_class($exception) . ": " . $exception->getMessage() 'detail' => get_class($exception) . ": " . $exception->getMessage()
]])); ]]));

Loading…
Cancel
Save