Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

中间抛出异常,无法被父级中间件获取 #72

Open
MonGDCH opened this issue Sep 29, 2022 · 0 comments
Open

中间抛出异常,无法被父级中间件获取 #72

MonGDCH opened this issue Sep 29, 2022 · 0 comments

Comments

@MonGDCH
Copy link

MonGDCH commented Sep 29, 2022

class A implements MiddlewareInterface
{
    public function process(Request $request, callable $next): Response
    {
        $response = $next($request);
        $err = $response->exception();
        if ($err) {
            var_dump($err->getMessage());
            return response('err');
        }
        return $response;
    }
}

class B implements MiddlewareInterface
{
    public function process(Request $request, callable $next): Response
    {
        throw new \ErrorException('tes234t');
        $response = $next($request);
        return $response;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant