12345678910111213141516171819202122232425 |
- <?php
-
- namespace Luticate\Utils;
-
- use Exception;
- use Symfony\Component\HttpKernel\Exception\HttpException;
- use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
-
- class LuHandler extends ExceptionHandler {
-
- public function render($request, Exception $e)
- {
- LuLog::log($e);
- $data = "Internal error";
- $code = 500;
-
- if ($e instanceof HttpException)
- {
- $data = $e->getMessage();
- $code = $e->getStatusCode();
- }
- return response(LuOutputFormatter::formatError($code, $data), $code);
- }
-
- }
|