titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

Throwing exceptions wastes resources

Open ByronAP opened this issue 6 years ago • 2 comments

It looks like there are a few places where exceptions are intentionally being throw. This seems to have a very adverse effect on performance, especially in RequestHandler and ResponseHandler and how they bubble up.

ByronAP avatar Sep 22 '19 22:09 ByronAP

Agree, I also hate that much exceptions. Something shoud be done :)

honfika avatar Nov 16 '19 22:11 honfika

I noted up to 54 exception explicitly thrown. I am to blame for writing the most new exceptions :-) https://github.com/justcoding121/Titanium-Web-Proxy/search?q=throw

Some of the exceptions are thrown so that the client/server connection can be disposed on the parent call. A way to reduce this would be to log the error, then dispose the connections immediately if they are in scope. If client/server connections are in parent scope, we need to return an error status from child method to parent method, so that parent can call dispose.

justcoding121 avatar Nov 17 '20 21:11 justcoding121