9#include <cosmos/dso_export.h>
10#include <cosmos/error/macros.hxx>
75 public std::exception {
78 explicit CosmosError(
const std::string_view error_class,
const std::string_view fixed_text = {}) :
79 m_error_class{error_class} {
103 const char* what()
const throw() override;
106 std::
string shortWhat() const;
109 [[ noreturn ]] virtual
void raise() = 0;
125 virtual
void generateMsg()
const {};
129 m_error_class = error_class;
139 mutable bool m_msg_generated =
false;
140 const char *m_file =
nullptr;
141 const char *m_func =
nullptr;
Base class for libcosmos exceptions.
void setErrorClass(const std::string_view error_class)
Allows to override error class to allow simpler implementation of derived types.
std::string m_msg
Runtime generated error message.
CosmosError & setInfo(const char *file, const size_t line, const char *func)
Set exception context information.
std::string_view m_error_class
Descriptive, unique error class label.