7#include "errors/impl/runtime_error.hpp"
23template <
typename Code>
42 this->message +=
" [code=" + std::to_string(
code) +
"]";
45 const char *
what() const noexcept
override
55static_assert(!std::is_abstract<code_error<unsigned int>>());
std::optional< source_location > location() const noexcept override
Get the source location of this error, if any.
Definition base_error.hpp:28
An error that has a code.
Definition code_error.hpp:24
code_error(const std::string &message, Code code, source_location location)
Constructor with message, code and source_location.
Definition code_error.hpp:37
const char * what() const noexcept override
Get error message.
Definition code_error.hpp:45
Code code
The error code.
Definition code_error.hpp:52
An error that has a message.
Definition runtime_error.hpp:18
std::string message
The error message.
Definition runtime_error.hpp:41
The source location.
Definition source_location.hpp:46