Skip to content

Commit 483fb0b

Browse files
committed
docs(api): update the API documentation of errors::Error::message method
1 parent b2ad861 commit 483fb0b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/errors/error.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,17 @@ class [[nodiscard]] Error {
5050
public:
5151
/**
5252
* @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.
5357
*
5458
* @code{.cpp}
5559
* const auto err = errors::make("unknown error");
60+
* const auto no_err = errors::nil();
5661
*
57-
* // Print "unknown error"
58-
* std::cout << err << std::endl;
62+
* // Print "unknown error, no error".
63+
* std::cout << err.message() << ", " << no_err.message() << std::endl;
5964
* @endcode
6065
*/
6166
std::string_view message() const;

0 commit comments

Comments
 (0)