Re: Feature idea: scope (failure, ExceptionSpecification) for catching exceptions

2015-03-28 Thread Andrej Mitrovic via Digitalmars-d
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

Re: Feature idea: scope (failure, ExceptionSpecification) for catching exceptions

2015-03-27 Thread Jacob Carlborg via Digitalmars-d
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

Re: Feature idea: scope (failure, ExceptionSpecification) for catching exceptions

2015-03-26 Thread w0rp via Digitalmars-d
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.

Re: Feature idea: scope (failure, ExceptionSpecification) for catching exceptions

2015-03-26 Thread Vladimir Panteleev via Digitalmars-d
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

Feature idea: scope (failure, ExceptionSpecification) for catching exceptions

2015-03-26 Thread Andrej Mitrovic via Digitalmars-d
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