24 const char*
what() const noexcept
override {
47 using runtime_error::runtime_error;
52[[nodiscard]]
constexpr bool isGood(
UA_StatusCode code)
noexcept {
53 return (code >> 30U) == 0x00;
56[[nodiscard]]
constexpr bool isUncertain(
UA_StatusCode code)
noexcept {
57 return (code >> 30U) == 0x01;
60[[nodiscard]]
constexpr bool isBad(
UA_StatusCode code)
noexcept {
61 return (code >> 30U) >= 0x02;
65[[nodiscard]]
inline UA_StatusCode getStatusCode(std::exception_ptr eptr)
noexcept {
68 std::rethrow_exception(eptr);
70 }
catch (
const BadStatus& e) {
72 }
catch (
const std::bad_alloc& ) {
86 if (detail::isBad(code)) {
Specific exception for open62541 status code UA_STATUSCODE_BADDISCONNECT.
Exception for bad status codes from open62541 UA_STATUSCODE_*.
BadStatus(UA_StatusCode code)
UA_StatusCode code() const noexcept
const char * what() const noexcept override
Exception for type-related errors.
constexpr void throwIfBad(UA_StatusCode code)
Check the status code and throw a BadStatus exception if the status code is bad.
#define UA_STATUSCODE_BADINTERNALERROR
#define UA_STATUSCODE_BADOUTOFMEMORY
#define UA_STATUSCODE_GOOD
#define UA_STATUSCODE_BADDISCONNECT
UA_EXPORT const char * UA_StatusCode_name(UA_StatusCode code)