23class Error :
public std::exception
34 Error(
const std::string& file,
int line,
const std::string&
what)
35 : what_(file +
":" + std::to_string(line) +
": " +
what)
42 virtual const char*
what() const noexcept
override {
return what_.c_str(); }
46 const std::string what_;
73 const std::string& file,
75 const std::string& func,
78 const std::string& clarification
83 func +
": Trying to perform binary operation " +
" " + std::to_string(lengthA) +
", "
84 + std::to_string(lengthB) +
" " + clarification
96#define NeoFOAM_ASSERT_EQUAL_LENGTH(_op1, _op2) \
97 if (_op1.size() != _op2.size()) \
99 throw ::NeoFOAM::DimensionMismatch( \
100 __FILE__, __LINE__, __func__, _op1.size(), _op2.size(), "expected equal dimensions" \
Error for handling two containers of incompatible lengths.
DimensionMismatch(const std::string &file, int line, const std::string &func, size_t lengthA, size_t lengthB, const std::string &clarification)
Base class for consistent error representation.
virtual const char * what() const noexcept override
Error(const std::string &file, int line, const std::string &what)