From d041bf130154c7ef7ea2b201b29de3de87e8f229 Mon Sep 17 00:00:00 2001 From: wolf Date: Sun, 1 Nov 1998 22:22:51 +0000 Subject: [PATCH] Change another small piece in the exception handling mechanism. git-svn-id: https://svn.dealii.org/trunk@618 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/exceptions.h | 30 ++++++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index b3293c7683..fef9d1119d 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -6,6 +6,8 @@ #include +#include + @@ -25,7 +27,7 @@ * @see DeclException0 * @author Wolfgang Bangerth, November 1997 */ -class ExceptionBase { +class ExceptionBase : public exception { public: ExceptionBase () : file(""), line(0), function(""), cond(""), exc("") {}; @@ -45,6 +47,7 @@ class ExceptionBase { * put it here. */ ExceptionBase (const ExceptionBase &e) : + exception(e), file(e.file), line(e.line), function(e.function), cond(e.cond), exc(e.exc) {}; @@ -54,11 +57,11 @@ class ExceptionBase { * put it here. */ ExceptionBase & operator = (const ExceptionBase &e) { - file = e.file; - line = e.line; + file = e.file; + line = e.line; function = e.function; - cond = e.cond; - exc = e.exc; + cond = e.cond; + exc = e.exc; return *this; }; @@ -110,6 +113,21 @@ class ExceptionBase { }; + /** + * Function derived from the base class + * which allows to pass information like + * the line and name of the file where the + * exception occured as well as user + * information. + * + * This function is mainly used when using + * exceptions declared by the + * #DeclException*# macros with the #throw# + * mechanism or the #Assert_or_Throw# macro. + */ +// virtual const char * what () const; + + const char *file; int line; const char *function; @@ -429,8 +447,6 @@ class Exception5 : public ExceptionBase { \ way. */ -#include - /** * Exception class to be thrown whenever an I/O operation in the library -- 2.39.5