[Dune-devel] [Dune-Commit] [Commit] dune-istl - 23d94ff: [tests] Catch Dune exceptions to ease identifying problems.

Jö Fahlke jorrit at jorrit.de
Wed Oct 21 16:25:23 CEST 2015


Am Wed, 21. Oct 2015, 09:12:53 +0200 schrieb Christian Engwer:
> Date: Wed, 21 Oct 2015 09:12:53 +0200
> From: Christian Engwer <christian.engwer at uni-muenster.de>
> To: dune-devel at dune-project.org
> Cc: dune-commit at dune-project.org
> Subject: Re: [Dune-devel] [Dune-Commit] [Commit] dune-istl - 23d94ff:
>  [tests] Catch Dune exceptions to ease identifying problems.
> 
> Hi Christoph,
> 
> if you add a try/catch, please also add an exit code which signals
> failure. Also in the general catch, it would be helpful to at least
> state that an unknown exception occured.

In general, it is a good idea to just rethrow the exception with an
operand-less throw-expression ("throw;").  The default terminate-handler (see
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/termination.html#support.termination.verbose)
will then print the exact dynamic type of the exception.  And it would
actually print the message, too, if we would derive Dune::Exception from
std::exception.

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

Kiss a non-smoker; taste the difference.
-- fortune
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20151021/a70bfbe8/attachment.sig>


More information about the Dune-devel mailing list