File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1313use Psr \Http \Server \MiddlewareInterface ;
1414use Psr \Http \Server \RequestHandlerInterface ;
1515use Throwable ;
16- use Yiisoft \ErrorHandler \Event \ApplicationError ;
1716use Yiisoft \ErrorHandler \ErrorHandler ;
17+ use Yiisoft \ErrorHandler \Event \ApplicationError ;
1818use Yiisoft \ErrorHandler \HeadersProvider ;
1919use Yiisoft \ErrorHandler \Renderer \HeaderRenderer ;
2020use Yiisoft \ErrorHandler \Renderer \HtmlRenderer ;
@@ -128,13 +128,14 @@ public function forceContentType(string $contentType): self
128128
129129 public function process (ServerRequestInterface $ request , RequestHandlerInterface $ handler ): ResponseInterface
130130 {
131- $ t = null ;
132131 try {
133132 return $ handler ->handle ($ request );
134133 } catch (Throwable $ t ) {
135- $ this ->eventDispatcher ?->dispatch(new ApplicationError ($ t ));
136- } finally {
137- /** @psalm-suppress PossiblyNullArgument $t is set in catch() statement */
134+ try {
135+ $ this ->eventDispatcher ?->dispatch(new ApplicationError ($ t ));
136+ } catch (Throwable $ e ) {
137+ // ignore exceptions thrown in event handlers
138+ }
138139 return $ this ->generateErrorResponse ($ t , $ request );
139140 }
140141 }
You can’t perform that action at this time.
0 commit comments