5#ifndef common_exceptions_hpp
6#define common_exceptions_hpp
9#include <source_location>
45 const std::source_location loc = std::source_location::current() )
56 const std::source_location loc =
57 std::source_location::current() )
67 virtual const char *
what() const noexcept
Augments an exception with the source file and line.
xwcException(const std::string &msg, const std::source_location loc=std::source_location::current())
Constructor.
std::string m_what
The full what message (message + file information).
std::source_location m_location
const std::string & message() const
Get the message.
int line() const
Get the source line.
std::string m_message
The explanatory message.
xwcException(const std::string &msg, int code, const std::source_location loc=std::source_location::current())
Constructor with code.
const std::string file_name() const
Get the source file.
virtual const char * what() const noexcept
Get the what string.
int code() const
Get the error code.
int m_code
An error code (optional)