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

LuHandler.php 549B

123456789101112131415161718192021222324
  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. $data = "Internal error";
  10. $code = 500;
  11. if ($e instanceof HttpException)
  12. {
  13. $data = $e->getMessage();
  14. $code = $e->getStatusCode();
  15. }
  16. return response(LuOutputFormatter::formatError($code, $data), $code);
  17. }
  18. }