您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LuHandler.php 573B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Luticate\Utils;
  3. use Exception;
  4. use Symfony\Component\HttpKernel\Exception\HttpException;
  5. use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
  6. class LuHandler extends ExceptionHandler {
  7. public function render($request, Exception $e)
  8. {
  9. LuLog::log($e);
  10. $data = "Internal error";
  11. $code = 500;
  12. if ($e instanceof HttpException)
  13. {
  14. $data = $e->getMessage();
  15. $code = $e->getStatusCode();
  16. }
  17. return response(LuOutputFormatter::formatError($code, $data), $code);
  18. }
  19. }