+ enum
+ {
+ ARCHIVE_TERMINATED = 1024,
+ KEYS_MUST_BE_STRINGS = 1025,
+ RECURSION_TOO_DEEP = 1026,
+ ALREADY_FAILED = 1027,
+ };
+
+ explicit Exception(unsigned error) :
+ Mf::Exception(error) {}
+
+ void raise()
+ {
+ throw *this;
+ }
+
+ const char* what() const throw()
+ {
+ switch (code)
+ {
+ case ARCHIVE_TERMINATED:
+ return "archive is already terminated";
+ case KEYS_MUST_BE_STRINGS:
+ return "map keys must be strings";
+ case RECURSION_TOO_DEEP:
+ return "generator recursion too deep";
+ case ALREADY_FAILED:
+ return "generator already errored out";
+ }
+ return Mf::Exception::what();
+ }