This commit is contained in:
2020-09-10 15:46:20 +08:00
parent 48c39103de
commit 03f20ae4e3
3 changed files with 34 additions and 6 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ namespace HttpServer\Route;
use Closure;
use Exception;
use HttpServer\Exception\ExitException;
use HttpServer\Http\Context;
use HttpServer\Http\Request;
use HttpServer\IInterface\RouterInterface;
@@ -405,7 +406,6 @@ class Router extends Application implements RouterInterface
$newPath[] = strtoupper($item->method) . ' : ' . $route . '/' . $item->path;
}
}
return $newPath;
}
@@ -424,6 +424,8 @@ class Router extends Application implements RouterInterface
} else {
$response = send($node->dispatch(), 200);
}
} catch (ExitException $exception) {
$response = send(Snowflake::app()->getLogger()->exception($exception), 200);
} catch (\Throwable $exception) {
$response = send(Snowflake::app()->getLogger()->exception($exception), 200);
} finally {