Error
-
namespace Error
The error component provides definitions, functions and macros for optional error management application wide.
-
enum class Utils::Error::ID : uint32_t
Identifiers for the different error codes.
Values:
-
enumerator OK
Generic no error, success.
-
enumerator UNKNOWN
Generic unknown error.
-
enumerator INVALID_ARGS
Generic invalid arguments error.
-
enumerator NULL_POINTER
Generic null pointer error.
-
enumerator CAPI_RUNTIME
Underlying error in the Common API C++ Runtime abstraction.
-
enumerator CAPI_CLIENT
Underlying error in the Common API C++ Client / Proxy abstraction.
-
enumerator CAPI_SERVER
Underlying error in the Common API C++ Server / Stub abstraction.
-
enumerator OK
-
class BaseException : public std::exception
Base exception for errors.
Public Functions
-
inline explicit BaseException(const std::string &what)
Class constructor.
- Parameters:
what – The message to be raised as part of the exception.
-
inline const char *what(void) const noexcept override
Message to raise for the exception.
- Returns:
Message for the exception as a C NULL terminated string.
-
inline explicit BaseException(const std::string &what)
-
RET_ON_ERROR(expr)
Triggers a
return
of when the given expression results in an error not Utils::Error::ID::OK.- Parameters:
expr – [in] The expression.
- Returns:
The error returned by
expr
.- Pre:
Requires an Error variable named
error
where to store the returned error.
-
RET_WITH_ERROR(expr, new_error)
Triggers a
return
with the error specified when the given expression results in an error not Utils::Error::ID::OK.- Parameters:
expr – [in] The expression.
new_error – [in] The error to return.
- Returns:
The error specified in
new_error
.
-
RET_ON_TRUE_WITH_ERROR(expr, new_error)
Triggers a
return
with the error specified when the given expression results intrue
.- Parameters:
expr – [in] The expression.
new_error – [in] The error to return.
- Returns:
The error specified in
new_error
.
-
END_ON_ERROR(expr)
Triggers a
goto
toend
label when the given expression results in an error not Utils::Error::ID::OK.- Parameters:
expr – [in] The expression.
- Pre:
Requires an Error variable named
error
where to store the returned error and aend
label.
-
END_WITH_ERROR(expr, new_error)
Triggers a
goto
toend
label with the error specified when the given expression results in an error not Utils::Error::ID::OK.- Parameters:
expr – [in] The expression.
new_error – [in] The error to store in the
error
variable defined.
- Pre:
Requires an Error variable named
error
where to store the returned error and aend
label.
-
END_ON_TRUE_WITH_ERROR(expr, new_error)
Triggers a
goto
toend
label with the error specified when the given expression results intrue
.- Parameters:
expr – [in] The expression.
new_error – [in] The error to store in the
error
variable defined.
- Pre:
Requires an Error variable named
error
where to store the returned error and aend
label.