Checked for more usual realife error cascade situation
This commit is contained in:
+10
-2
@@ -8,6 +8,14 @@
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifndef THROW
|
||||
#ifdef CODE_ERROR_LOCATIONS
|
||||
#define THROW(type, ...) throw type(__VA_ARGS__, __LINE__, __FILE__)
|
||||
#else
|
||||
#define THROW(type, ...) throw type(__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace nb {
|
||||
|
||||
typedef std::unordered_map<unsigned int, const char*> ErrorCodeMap;
|
||||
@@ -98,8 +106,8 @@ public:
|
||||
};
|
||||
|
||||
Error(unsigned int code) : ErrorBase<Error>(code, ErrorBase<Error>::lookup(code)) {}
|
||||
Error(unsigned int code, const std::exception& trace)
|
||||
: ErrorBase<Error>(code, ErrorBase<Error>::lookup(code), trace) {}
|
||||
Error(unsigned int code, const std::exception& trace, unsigned int line=0, const std::string& filename="")
|
||||
: ErrorBase<Error>(code, ErrorBase<Error>::lookup(code), trace, line, filename) {}
|
||||
|
||||
friend ErrorBase<Error>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user