removed errorCode

This commit is contained in:
badaix 2015-08-31 23:38:28 +02:00
parent 442263af31
commit 016856edaf

View file

@ -26,15 +26,14 @@
// text_exception uses a dynamically-allocated internal c-string for what():
class SnapException : public std::exception {
char* text_;
int errorCode_;
public:
SnapException(const char* text, int errorCode = 0) : errorCode_(errorCode)
SnapException(const char* text)
{
text_ = new char[std::strlen(text) + 1];
std::strcpy(text_, text);
}
SnapException(const std::string& text, int errorCode = 0) : errorCode_(errorCode)
SnapException(const std::string& text)
{
text_ = new char[text.size()];
std::strcpy(text_, text.c_str());
@ -55,11 +54,6 @@ public:
{
return text_;
}
virtual int errorCode() const noexcept
{
return errorCode_;
}
};