diff options
author | Carl Hetherington <carl@carlh.net> | 2012-06-18 18:28:19 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-06-18 18:28:19 +0000 |
commit | 24b418598ad2637f1f929380047f85d2cf2b7b33 (patch) | |
tree | b7789c030669391c77daec2537f49034bc9226b1 /libs/pbd/pbd/enumwriter.h | |
parent | 49fec4f43072f2600c921ea714dacc868370aa53 (diff) |
Make EnumWriter exceptions a bit more informative.
git-svn-id: svn://localhost/ardour2/branches/3.0@12758 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/enumwriter.h')
-rw-r--r-- | libs/pbd/pbd/enumwriter.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libs/pbd/pbd/enumwriter.h b/libs/pbd/pbd/enumwriter.h index 600f59bf29..95f1ea9e9f 100644 --- a/libs/pbd/pbd/enumwriter.h +++ b/libs/pbd/pbd/enumwriter.h @@ -25,13 +25,26 @@ #include <string> #include <vector> #include <exception> - +#include <sstream> namespace PBD { class unknown_enumeration : public std::exception { public: - virtual const char *what() const throw() { return "unknown enumerator in PBD::EnumWriter"; } + unknown_enumeration (std::string const & e) throw() { + std::stringstream s; + s << "unknown enumerator " << e << " in PBD::EnumWriter"; + _message = s.str (); + } + + ~unknown_enumeration () throw() {} + + virtual const char *what() const throw() { + return _message.c_str(); + } + +private: + std::string _message; }; class EnumWriter { |