We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
errors::Error::message
1 parent b2ad861 commit 483fb0bCopy full SHA for 483fb0b
include/errors/error.hpp
@@ -50,12 +50,17 @@ class [[nodiscard]] Error {
50
public:
51
/**
52
* @brief Returns the error message.
53
+ * @returns The error message.
54
+ *
55
+ * Returns the error message as a string view.
56
+ * If the object does not contain an error, it will return the string "no error" instead.
57
*
58
* @code{.cpp}
59
* const auto err = errors::make("unknown error");
60
+ * const auto no_err = errors::nil();
61
- * // Print "unknown error"
- * std::cout << err << std::endl;
62
+ * // Print "unknown error, no error".
63
+ * std::cout << err.message() << ", " << no_err.message() << std::endl;
64
* @endcode
65
*/
66
std::string_view message() const;
0 commit comments