X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FError.hh;h=c452ae6df836f8351660b5cd0e460239f1932697;hb=81ff940d1bea07447f8218ab9a764fbf393431e8;hp=05c637705a96d77c91169803e41ae4b1b7f8f6fc;hpb=987971a961454d97082c6448fdc0bbeb540281bb;p=chaz%2Fyoink 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; }