Added HTTP status codes to exception interceptors

This commit is contained in:
Marcin Kurczewski 2014-05-20 20:51:07 +02:00
parent 956283f4a0
commit bba35875a3
5 changed files with 29 additions and 18 deletions

View file

@ -39,6 +39,7 @@ class ApiController extends AbstractController
}
catch (Exception $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}

View file

@ -20,6 +20,7 @@ class AuthController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
$this->renderView('auth-login');
}

View file

@ -34,6 +34,7 @@ class PostController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}

View file

@ -93,6 +93,7 @@ class TagController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}
@ -119,6 +120,7 @@ class TagController extends AbstractController
}
catch (Exception $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}

View file

@ -53,6 +53,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}
@ -106,6 +107,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}
@ -132,6 +134,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
$this->renderView('user-view');
}
@ -233,6 +236,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}
@ -276,6 +280,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}
@ -316,6 +321,7 @@ class UserController extends AbstractController
}
catch (SimpleException $e)
{
\Chibi\Util\Headers::setCode(400);
Messenger::fail($e->getMessage());
}