Error Handling

All failable Zenoh methods accept pointer to zenoh::ZResult as an optional argument. If it is not provided (or set to nullptr) a zenoh::ZException will be thrown in case of failure. Otherwise a error code will be written to provided pointer and no exception will be thrown from Zenoh side. If corresponding method is expected to return or consume (via std::move) any objects, they will be reset to gravestone state (i.e. None of the functions or methods will work with the object in this state, except explicit conversion to bool, which will return false).

class ZException : public std::runtime_error

Zenoh-specific Exception.

typedef ::z_result_t zenoh::ZResult

Error code returned by Zenoh API.