garydgregory commented on issue #117: Refactor APIs like failed(Exception) to 
failed(String, Exception)
URL: 
https://github.com/apache/httpcomponents-core/pull/117#issuecomment-480095412
 
 
   Hi @ok2c,
   
   ```Why not considering my suggestion of simply wrapping the original 
exception?```
   
   That's how I coded it initially but it feels like a hack and when you look 
at result it looks like a hack to me; YMMV.
   
   The idea here IMO is that since we are still in beta, is to consider what is 
the _best_ API moving forward. So for me the breadth of the change is not 
important as long as the change is for the better.
   
   The way I look at it is:
   - When I call a failed() API and I have more to say than the exception, 
having to nest an exception feels weird when all I want is to give some 
information. 
   - When I implement a `failed()` API and I get a message and an exception, I 
can format things maybe in a nicer way rather than just dumping the stack trace 
and assuming that message at the top is meaningful. If I do dump the stack 
trace, then I have yet another level of stack frames to look at, which is not 
so nice in this case.
   
   I'm open to doing it either way, but my guess is that this is not the first 
time this will come up. In this specific case, it is something that's been 
bugging me forever, I just never took the time to do anything about it ;-)
   
   Gary

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to