[Dune-devel] [Dune-Commit] [Commit] dune-istl - 23d94ff: [tests] Catch Dune exceptions to ease identifying problems.
Christoph Grüninger
christoph.grueninger at iws.uni-stuttgart.de
Fri Oct 23 07:55:41 CEST 2015
Dear Christian, dear Jö,
>> 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.
You are right. Copy & paste is easy but should not be considered a
no-brainer. I'll fix this.
> 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.
I like the idea of making Dune::Exception a std::exception. But we have
our Dune::Exception::what() returning a std::string& and not a char*.
Can we easily change this without braking all code using our exceptions?
And would we get rid of DUNE_THROW? That would be an argument for me to
break code.
Shall I open a flyspray task to discuss this more widely? Or is this no
consideration?
Bye
Christoph
--
A mathematician is a scientist who can figure out anything, except
such simple things as squaring the circle and trisecting an angle.
[Evan Esar (1899-1995), Esar's Comic Dictionary]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20151023/af8146b3/attachment.sig>
More information about the Dune-devel
mailing list