Visual/text changes to error format output

This commit is contained in:
NaifBanana 2025-11-10 00:04:28 -06:00
parent 3f0486b889
commit 17624e9e3c
2 changed files with 3 additions and 13 deletions

View File

@ -73,7 +73,7 @@ protected:
); );
_msg += std::string(ErrorType::type); _msg += std::string(ErrorType::type);
_msg += "-" + std::to_string(_code); _msg += "." + std::to_string(_code);
if (line && filename.size()) { if (line && filename.size()) {
_msg += " in \'" + filename + "\':" + std::to_string(line); _msg += " in \'" + filename + "\':" + std::to_string(line);
} }
@ -92,7 +92,7 @@ protected:
what_msg.replace(newline_pos, 1, "\n "); what_msg.replace(newline_pos, 1, "\n ");
newline_pos = what_msg.find("\n", newline_pos+1); newline_pos = what_msg.find("\n", newline_pos+1);
} }
_msg += "\n Trace: " + what_msg; _msg += "\n Trace: " + what_msg;
} }
unsigned int _code; unsigned int _code;

View File

@ -6,12 +6,7 @@
using namespace nb; using namespace nb;
class TestError : public ErrorBase<TestError> { class TestError : public ErrorBase<TestError> {
public: public:
//TestError(unsigned int code, unsigned int line=0, const std::string& filename="")
// : ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code)) {}
//TestError(unsigned int code, const std::exception& trace, unsigned int line=0, const std::string& filename="")
// : ErrorBase<TestError>(code, ErrorBase<TestError>::lookup(code), trace, line, filename) {}
using ErrorBase<TestError>::ErrorBase; using ErrorBase<TestError>::ErrorBase;
enum ErrorCodes : unsigned int { enum ErrorCodes : unsigned int {
@ -30,11 +25,6 @@ const ErrorCodeMap TestError::ErrorMessages{
}; };
int main() { 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 { try {
try { try {