On 3/26/15, Vladimir Panteleev via Digitalmars-d
wrote:
> What is your use case for only logging specific exception types?
We already have scope(failure) with its defined semantics (it will not
swallow the exception), changing that would be bad. So the only
workable solution I see is to extend it
On 2015-03-26 12:23, Andrej Mitrovic via Digitalmars-d wrote:
One idea I'd like to see is to enhance scope(failure) to allow it to
catch a specific type of exception which would allow us to e.g. log
the exception message and potentially re-throw the exception. All of
this without having to nest o
I think I'd tend towards not adding this feature. It seems like
it's just a logging problem, and try-catch is probably enough for
that.
On Thursday, 26 March 2015 at 11:23:34 UTC, Andrej Mitrovic wrote:
Granted it's not the best example out there, but I think it has
potential. Thoughts?
Your example will print the exception message 2 (or 3) times. Is
this really necessary?
I've found that
scope(failure) log("Failure while t
One idea I'd like to see is to enhance scope(failure) to allow it to
catch a specific type of exception which would allow us to e.g. log
the exception message and potentially re-throw the exception. All of
this without having to nest our code in try/catch statements.
So instead of having code such