Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Error.hpp
1#pragma once
2
3#include <fmt/format.h>
4#include <fmt/std.h>
5
6#include <string>
7#include <utility>
8
9namespace util::async {
10
21 ExecutionError(std::string tid, std::string msg)
22 : message{fmt::format("Thread {} exit with exception: {}", std::move(tid), std::move(msg))}
23 {
24 }
25
26 ExecutionError(ExecutionError const&) = default;
27 ExecutionError(ExecutionError&&) = default;
29 operator=(ExecutionError&&) = default;
31 operator=(ExecutionError const&) = default;
32
38 [[nodiscard]]
39 operator char const*() const noexcept
40 {
41 return message.c_str();
42 }
43
44 std::string message;
45};
46
47} // namespace util::async
This namespace implements an async framework built on top of execution contexts.
Definition AnyExecutionContext.hpp:18
Error channel type for async operation of any ExecutionContext.
Definition Error.hpp:14
ExecutionError(std::string tid, std::string msg)
Construct a new Execution Error object.
Definition Error.hpp:21