9#include <uni20/config.hpp>
12#include <source_location>
17#if UNI20_HAS_STACKTRACE
34 [[nodiscard]] std::optional<std::source_location>
const&
source_location() const noexcept
36 return source_location_;
39#if UNI20_HAS_STACKTRACE
41 void set_stacktrace(std::stacktrace stacktrace) { stacktrace_ = std::move(stacktrace); }
44 [[nodiscard]] std::optional<std::stacktrace>
const& stacktrace() const noexcept {
return stacktrace_; }
48 std::optional<std::source_location> source_location_;
49#if UNI20_HAS_STACKTRACE
50 std::optional<std::stacktrace> stacktrace_;
Base class for exceptions raised through Uni20's diagnostic boundary.
Definition diagnostic_error.hpp:25
std::optional< std::source_location > const & source_location() const noexcept
Return the attached source location, if any.
Definition diagnostic_error.hpp:34
void set_source_location(std::source_location where) noexcept
Attach the source location at which the exception is raised.
Definition diagnostic_error.hpp:31
diagnostic_error(std::string message)
Construct an exception with its concise plain-text message.
Definition diagnostic_error.hpp:28
Definition async/async.hpp:26