Added HTTP status codes to exception interceptors
This commit is contained in:
parent
956283f4a0
commit
bba35875a3
5 changed files with 29 additions and 18 deletions
|
@ -39,6 +39,7 @@ class ApiController extends AbstractController
|
|||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
\Chibi\Util\Headers::setCode(400);
|
||||
Messenger::fail($e->getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ class AuthController extends AbstractController
|
|||
}
|
||||
catch (SimpleException $e)
|
||||
{
|
||||
\Chibi\Util\Headers::setCode(400);
|
||||
Messenger::fail($e->getMessage());
|
||||
$this->renderView('auth-login');
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ class PostController extends AbstractController
|
|||
}
|
||||
catch (SimpleException $e)
|
||||
{
|
||||
\Chibi\Util\Headers::setCode(400);
|
||||
Messenger::fail($e->getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue