25class Error :
public std::exception
36 Error(
const std::string& file,
int line,
const std::string&
what)
37 : what_(file +
":" + std::to_string(line) +
": " +
what)
44 virtual const char*
what() const noexcept
override {
return what_.c_str(); }
48 const std::string what_;
75 const std::string& file,
77 const std::string& func,
80 const std::string& clarification
85 func +
": Trying to perform binary operation " +
" " + std::to_string(lengthA) +
", "
86 + std::to_string(lengthB) +
" " + clarification
98#define NeoN_ASSERT_EQUAL_LENGTH(_op1, _op2) \
99 auto s1 = static_cast<localIdx>(_op1.size()); \
100 auto s2 = static_cast<localIdx>(_op2.size()); \
103 throw ::NeoN::DimensionMismatch( \
104 __FILE__, __LINE__, __func__, s1, s2, "expected equal dimensions" \
Error for handling two containers of incompatible lengths.
DimensionMismatch(const std::string &file, int line, const std::string &func, localIdx lengthA, localIdx lengthB, const std::string &clarification)
Base class for consistent error representation.
Error(const std::string &file, int line, const std::string &what)
virtual const char * what() const noexcept override