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);
}
mCode = code;
}
- virtual void raise()
+ virtual void raise() const
{
throw *this;
}
return mWhat;
}
- bool isError() const throw()
+ operator bool () const
{
+ // resolves to true if error code is not NONE
return mCode != NONE;
}
+ void reset() throw()
+ {
+ mCode = NONE;
+ mWhat[0] = '\0';
+ }
+
private:
unsigned mCode;