Throwable class design

Mehrdad wfunction at hotmail.com
Tue Jan 29 23:23:48 PST 2013


On Wednesday, 30 January 2013 at 07:01:56 UTC, H. S. Teoh wrote:
> Not true. I use this idiom a lot: a lower level function throws 
> an error message (e.g., integer format error), and a 
> catch-block halfway up the call-chain modifies .msg to include 
> contextual information (e.g., filename, line number) and 
> rethrows the exception, so that at the top level the error 
> message contains both context information and the low-level 
> error message.


Shouldn't you be throwing a new exception, with the old exception 
wrapped inside?


More information about the Digitalmars-d mailing list