diff options
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parser.h b/src/parser.h index 8e73d64..f29ea38 100644 --- a/src/parser.h +++ b/src/parser.h @@ -18,6 +18,9 @@ #ifndef __PARSER_H #define __PARSER_H +#include <exception> +#include <typeinfo> + #include <glib.h> #include <glib/gprintf.h> @@ -156,6 +159,14 @@ public: void display_full(void); }; + class StdError : public Error { + public: + StdError(const gchar *type, const std::exception &error) + : Error("%s: %s", type, error.what()) {} + StdError(const std::exception &error) + : Error("%s: %s", typeid(error).name(), error.what()) {} + }; + class GError : public Error { public: GError(const ::GError *gerror) |