zf-fr / zfr-rest

A module for Zend Framework 2 that aims to simplify RESTful
81 stars 31 forks source link

Mapping custom returns code 200 instead of exception code #204

Closed bartek75 closed 8 years ago

bartek75 commented 8 years ago

I mapped custom exception in 'zfr_rest_global.php' file 'exception_map' => [ 'Doctrine\DBAL\Exception\UniqueConstraintViolationException' => 'ZfrRest\Http\Exception\Client\ConflictException' ], Then a return code 200 is in response. < HTTP/1.1 200 OK < Date: Mon, 28 Mar 2016 06:16:14 GMT <* Server Apache/2.4.9 (Win32) PHP/5.5.12 is not blacklisted < Server: Apache/2.4.9 (Win32) PHP/5.5.12 < Access-Control-Allow-Origin: * < Access-Control-Allow-Methods: POST, GET, PUT, OPTIONS, PATCH, DELETE < Access-Control-Allow-Headers: X-Accept-Charset,X-Accept,Content-Type,app,key < X-Powered-By: PHP/5.5.12 < Content-Length: 452 < Content-Type: application/json < {"status_code":409,"message":"An exception occurred while

bartek75 commented 8 years ago

It is the problem with the doctrine