NetServices: Add custom error message to BNetworkRequestError

Change-Id: I03970762531a689e25cd78a1091aecf755ee87ce
This commit is contained in:
Niels Sascha Reedijk
2022-08-07 08:47:19 +01:00
parent 6d1bb0e7ad
commit 9cb56a4881
5 changed files with 75 additions and 14 deletions
+28 -2
View File
@@ -212,15 +212,31 @@ namespace Network {
/*!
\fn BNetworkRequestError::BNetworkRequestError(const char *origin, ErrorType type,
status_t errorCode=B_OK)
status_t errorCode, const BString& customMessage = BString())
\brief Create a new network request error.
\param origin A string representing where this error occured. It is advised
to initialize it to \c __PRETTY_FUNCTION__ by default.
\param type The error type that describes what the issue was that prevented the completion of
the request.
\param errorCode Optional underlying system error. See the \ref BNetworkRequestError::ErrorType
\param errorCode The underlying system error. See the \ref BNetworkRequestError::ErrorType
documentation on which error types expect a system error.
\param customMessage Optional custom message describing the reason or cause for the error.
\since Haiku R1
*/
/*!
\fn BNetworkRequestError::BNetworkRequestError(const char *origin, ErrorType type,
const BString& customMessage = BString())
\brief Create a new network request error.
\param origin A string representing where this error occured. It is advised
to initialize it to \c __PRETTY_FUNCTION__ by default.
\param type The error type that describes what the issue was that prevented the completion of
the request.
\param customMessage Optional custom message describing the reason or cause for the error.
\since Haiku R1
*/
@@ -248,6 +264,16 @@ namespace Network {
*/
/*!
\fn const char* BNetworkRequestError::CustomMessage() const noexcept
\brief Get the custom error message.
\return Get the custom error message. This may be an empty string if it was not set.
\since Haiku R1
*/
/*!
\fn BString encode_to_base64(const BString& string)
\brief Utility function that encodes a \a string to base64 and returns the result.