X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FError.hh;h=c452ae6df836f8351660b5cd0e460239f1932697;hp=05c637705a96d77c91169803e41ae4b1b7f8f6fc;hb=e973a129b5b83b628ba3f09e8c95682fc74080cd;hpb=4f9eb9259092994de9690cf12f11437c35a6791e diff --git a/src/Moof/Error.hh b/src/Moof/Error.hh index 05c6377..c452ae6 100644 --- a/src/Moof/Error.hh +++ b/src/Moof/Error.hh @@ -57,7 +57,7 @@ public: UNKNOWN_IMAGE_FORMAT, // name of resource }; - explicit Error(unsigned code, const std::string& what = "") + explicit Error(unsigned code = NONE, const std::string& what = "") { init(code, what); } @@ -70,7 +70,7 @@ public: mCode = code; } - virtual void raise() + virtual void raise() const { throw *this; } @@ -85,8 +85,9 @@ public: return mWhat; } - bool isError() const throw() + operator bool () const { + // resolves to true if error code is not NONE return mCode != NONE; }