Error payload carried in Result on failure.
More...
#include <error.hpp>
Error payload carried in Result on failure.
Definition at line 76 of file error.hpp.
◆ as_cuda()
| const CudaError * cusbf::Error::as_cuda |
( |
| ) |
const |
|
inlinenoexcept |
Definition at line 89 of file error.hpp.
89 {
90 return std::get_if<CudaError>(&
kind);
91 }
std::variant< CudaError, IoError, FastxParseError, InvalidArgumentError, ResourceError > kind
◆ as_fastx_parse()
Definition at line 97 of file error.hpp.
97 {
98 return std::get_if<FastxParseError>(&
kind);
99 }
◆ as_invalid_argument()
Definition at line 101 of file error.hpp.
101 {
102 return std::get_if<InvalidArgumentError>(&
kind);
103 }
◆ as_io()
| const IoError * cusbf::Error::as_io |
( |
| ) |
const |
|
inlinenoexcept |
Definition at line 93 of file error.hpp.
93 {
94 return std::get_if<IoError>(&
kind);
95 }
◆ as_resource()
Definition at line 105 of file error.hpp.
105 {
106 return std::get_if<ResourceError>(&
kind);
107 }
◆ category()
Definition at line 79 of file error.hpp.
79 {
81 }
ErrorCategory
Error category for Result failures.
◆ cuda()
| static Error cusbf::Error::cuda |
( |
cudaError_t |
code, |
|
|
std::source_location |
location = std::source_location::current() |
|
) |
| |
|
inlinestatic |
Definition at line 110 of file error.hpp.
110 {
112 return Error{CudaError{
113 code,
114 site,
115 std::format("{}: {}", site.to_string(), cudaGetErrorString(code)),
116 }};
117 }
static SourceLocation from(std::source_location location)
◆ fastx_parse()
Definition at line 123 of file error.hpp.
123 {
124 const std::string location_text = site.to_string();
125 return Error{FastxParseError{
126 std::move(site),
127 std::format("{}: {}", location_text, detail),
128 }};
129 }
◆ invalid_argument()
| static Error cusbf::Error::invalid_argument |
( |
std::string |
message | ) |
|
|
inlinestatic |
Definition at line 131 of file error.hpp.
131 {
132 return Error{InvalidArgumentError{std::move(
message)}};
133 }
const std::string & message() const noexcept
◆ io()
| static Error cusbf::Error::io |
( |
std::string |
message | ) |
|
|
inlinestatic |
Definition at line 119 of file error.hpp.
119 {
120 return Error{IoError{std::move(
message)}};
121 }
◆ message()
| const std::string & cusbf::Error::message |
( |
| ) |
const |
|
inlinenoexcept |
Definition at line 83 of file error.hpp.
83 {
84 return std::visit(
85 [](
const auto& error) ->
const std::string& {
return error.message; },
kind
86 );
87 }
◆ resource()
| static Error cusbf::Error::resource |
( |
std::string |
message | ) |
|
|
inlinestatic |
Definition at line 135 of file error.hpp.
135 {
136 return Error{ResourceError{std::move(
message)}};
137 }
◆ kind
The documentation for this struct was generated from the following file: