AException#
Abstract AUI exception.
Header: | #include <AUI/Common/AException.h> |
CMake: | aui_link(my_target PUBLIC aui::core) |
Detailed Description#
Unlike std::exception, AException is capable to capture stack traces and efficiently output them to std::ostream. Also exception nesting is possible (via causedBy()).
Examples#
examples/7guis/cells/src/Spreadsheet.h
7GUIs Cells - Spreadsheet processor (Excel).
examples/7guis/cells/src/AST.cpp
7GUIs Cells - Spreadsheet processor (Excel).
const T& expect(const Variant& variant) {
if (std::holds_alternative<T>(variant)) {
return std::get<T>(variant);
}
throw AException("VALUE {}"_format(AClass<T>::name()).uppercase());
}
struct BinaryOperatorNode : public INode {
_unique<INode> left;
_unique<INode> right;
examples/7guis/cells/src/Tokens.cpp
7GUIs Cells - Spreadsheet processor (Excel).
t->reverseByte();
out << token::Identifier { t->readStringWhile([](char c) -> bool { return std::isalnum(c); }) };
continue;
}
throw AException("UNEXPECTED {}"_format(c));
}
}
} catch (const AEOFException&) {}
return out;
}
examples/7guis/cells/src/Functions.cpp
7GUIs Cells - Spreadsheet processor (Excel).