diff --git a/app/Exception/Handler/AppExceptionHandler.php b/app/Exception/Handler/AppExceptionHandler.php index 3df36c799..a1ac66dc9 100755 --- a/app/Exception/Handler/AppExceptionHandler.php +++ b/app/Exception/Handler/AppExceptionHandler.php @@ -15,6 +15,7 @@ use Hyperf\HttpMessage\Stream\SwooleStream; use Hyperf\Utils\Str; use Psr\Http\Message\ResponseInterface; +use Qbhy\HyperfAuth\Exception\UnauthorizedException; use Throwable; class AppExceptionHandler extends ExceptionHandler @@ -37,6 +38,7 @@ public function handle(Throwable $throwable, ResponseInterface $response) 'message' => $throwable->getMessage(), 'line' => $throwable->getLine(), 'file' => $throwable->getFile(), + 'link' => url(request()->getPathInfo()), ]); $log_id = $log['_id']; return $response->withHeader('Server', 'SForum')->withStatus(500)->withBody(new SwooleStream('Internal Server Error. log in ' . url('/admin/server/logger/' . $log_id . '.html') . '')); @@ -44,6 +46,6 @@ public function handle(Throwable $throwable, ResponseInterface $response) public function isValid(Throwable $throwable): bool { - return true; + return !$throwable instanceof UnauthorizedException; } }