cherrypy / cherrypy

CherryPy is a pythonic, object-oriented HTTP framework. https://cherrypy.dev
https://docs.cherrypy.dev
BSD 3-Clause "New" or "Revised" License
1.8k stars 357 forks source link

Bug in Timing tool example and before_handler docs improvement. #1990

Open Duiesel opened 1 year ago

Duiesel commented 1 year ago

Hi guys!

I found an error in documentation related to TimingTool example.

before_handler never happens if there are an error at request body processing step.

So suggesting improvement of TimingTool example and before_handler event in docs.

webknjaz commented 1 year ago

@Duiesel are you suggesting that this causes an AttributeError? Could you post a little STR / demonstration? Would you like to suggest a PR with a fix?

Duiesel commented 1 year ago

It causes nothing and this is the case. If you get any error at request body processing step, any tool attached to hook point before_handler never called. So it's not obvious and documentation says nothing about it. I've looked at source code to figure out what happened.

Anyway will do a PR with a docs improvement.

Duiesel commented 1 year ago

@webknjaz If needed I could add simple example.

webknjaz commented 1 year ago

I think you can go ahead and just submit an improvement PR...