diff --git a/include/Errors.hpp b/include/Errors.hpp index 8edab0a..42d67a9 100644 --- a/include/Errors.hpp +++ b/include/Errors.hpp @@ -73,7 +73,7 @@ protected: ); _msg += std::string(ErrorType::type); - _msg += "-" + std::to_string(_code); + _msg += "." + std::to_string(_code); if (line && filename.size()) { _msg += " in \'" + filename + "\':" + std::to_string(line); } @@ -92,7 +92,7 @@ protected: what_msg.replace(newline_pos, 1, "\n "); newline_pos = what_msg.find("\n", newline_pos+1); } - _msg += "\n Trace: " + what_msg; + _msg += "\n Trace: " + what_msg; } unsigned int _code; diff --git a/tests/ErrorTest/main.cpp b/tests/ErrorTest/main.cpp index f0eda15..ef71f51 100644 --- a/tests/ErrorTest/main.cpp +++ b/tests/ErrorTest/main.cpp @@ -6,12 +6,7 @@ using namespace nb; class TestError : public ErrorBase { -public: - //TestError(unsigned int code, unsigned int line=0, const std::string& filename="") - // : ErrorBase(code, ErrorBase::lookup(code)) {} - //TestError(unsigned int code, const std::exception& trace, unsigned int line=0, const std::string& filename="") - // : ErrorBase(code, ErrorBase::lookup(code), trace, line, filename) {} - +public: using ErrorBase::ErrorBase; enum ErrorCodes : unsigned int { @@ -30,11 +25,6 @@ const ErrorCodeMap TestError::ErrorMessages{ }; int main() { - //TestError d(TestError::ErrorCodes::D, std::out_of_range("hey")); - //TestError c(TestError::ErrorCodes::C, d); - //TestError b(TestError::ErrorCodes::B, c); - //TestError a(TestError::ErrorCodes::A, b); - //throw Error(Error::ErrorCodes::UNDEFINED, a); try { try { try {