drash icon indicating copy to clipboard operation
drash copied to clipboard

bug: ResponseTimeService not work when an exception occurs

Open biluohc opened this issue 3 years ago • 0 comments

Summary

The Service not work when an exception occurs, such as 40X or 50X.

Steps To Reproduce The Bug

$ curl -I 0.0.0.0:8000/404                                                                                                  
HTTP/1.1 200 OK
content-type: text/html
vary: Accept-Encoding
content-length: 569
date: Fri, 01 Jul 2022 15:10:59 GMT

Expected Behavior

The Service should work for all status code.

Suggested Solution(s)

When a service or resource behind a service throws an exception, it should also run the runAfterResource of this service after calling ErrorHandler.

Otherwise, middlewares such as Logger or ResponseTime will not work when exception occurs.

biluohc avatar Jul 01 '22 15:07 biluohc