How to handle try-catch blocks, nothrow and logfiles

2014-05-24 Thread Tim via Digitalmars-d-learn
I'm working on an application where I want log all exceptions but I'm not sure what's the best way to realize that. Sure I can do the following: void myMethod() nothrow { try { // Do something } catch (Exception e) { // Write log file } } But there are some

Re: How to handle try-catch blocks, nothrow and logfiles

2014-05-24 Thread Ali Çehreli via Digitalmars-d-learn
On 05/24/2014 10:09 AM, Tim wrote: I'm working on an application where I want log all exceptions but I'm not sure what's the best way to realize that. A common solution is to log it in the exception class'es constructor. We even dump the backtrace with libunwind in our C++ application.

Re: How to handle try-catch blocks, nothrow and logfiles

2014-05-24 Thread Tim via Digitalmars-d-learn
On Saturday, 24 May 2014 at 17:55:07 UTC, Ali Çehreli wrote: On 05/24/2014 10:09 AM, Tim wrote: I'm working on an application where I want log all exceptions but I'm not sure what's the best way to realize that. A common solution is to log it in the exception class'es constructor. We even

Re: How to handle try-catch blocks, nothrow and logfiles

2014-05-24 Thread monarch_dodra via Digitalmars-d-learn
On Saturday, 24 May 2014 at 17:09:24 UTC, Tim wrote: Imagine I've an application where I want log all thrown exceptions. Arguably, that's not something you'd want to do. In a normal application, exceptions get thrown around, and it is completely normal. In particular, the *thrower* has no

Re: How to handle try-catch blocks, nothrow and logfiles

2014-05-24 Thread Kagamin via Digitalmars-d-learn
On Saturday, 24 May 2014 at 17:09:24 UTC, Tim wrote: But doing this in all my methods You shouldn't do it in all methods, only top-level ones, because they are called from 3rd party code, which will do whatever things with the exceptions from nothing to terminating the application. Already