Error payload carried in Result on failure.
More...
#include <error.hpp>
Error payload carried in Result on failure.
Definition at line 64 of file error.hpp.
◆ as_cuda()
| const CudaError * cuddl::Error::as_cuda |
( |
| ) |
const |
|
inlinenoexcept |
Definition at line 77 of file error.hpp.
77 {
78 return std::get_if<CudaError>(&
kind);
79 }
std::variant< CudaError, InvalidArgumentError, ResourceError > kind
◆ as_invalid_argument()
Definition at line 81 of file error.hpp.
81 {
82 return std::get_if<InvalidArgumentError>(&
kind);
83 }
◆ as_resource()
Definition at line 85 of file error.hpp.
85 {
86 return std::get_if<ResourceError>(&
kind);
87 }
◆ category()
Definition at line 67 of file error.hpp.
67 {
69 }
ErrorCategory
Error category for Result failures.
◆ cuda()
| static Error cuddl::Error::cuda |
( |
cudaError_t |
code, |
|
|
std::source_location |
location = std::source_location::current() |
|
) |
| |
|
inlinestatic |
Definition at line 90 of file error.hpp.
90 {
92 return Error{CudaError{
93 code,
94 site,
95 std::format("{}: {}", site.to_string(), cudaGetErrorString(code)),
96 }};
97 }
static SourceLocation from(std::source_location location)
◆ invalid_argument()
| static Error cuddl::Error::invalid_argument |
( |
std::string |
message | ) |
|
|
inlinestatic |
Definition at line 99 of file error.hpp.
99 {
100 return Error{InvalidArgumentError{std::move(
message)}};
101 }
const std::string & message() const noexcept
◆ message()
| const std::string & cuddl::Error::message |
( |
| ) |
const |
|
inlinenoexcept |
Definition at line 71 of file error.hpp.
71 {
72 return std::visit(
73 [](
const auto& error) ->
const std::string& {
return error.message; },
kind
74 );
75 }
◆ resource()
| static Error cuddl::Error::resource |
( |
std::string |
message | ) |
|
|
inlinestatic |
Definition at line 103 of file error.hpp.
103 {
104 return Error{ResourceError{std::move(
message)}};
105 }
◆ kind
The documentation for this struct was generated from the following file: