23 lines
449 B
C++
23 lines
449 B
C++
#include "ErrorCode.h"
|
|
#include <nng/nng.h>
|
|
|
|
namespace Nng {
|
|
const char *ErrorCategory::name() const noexcept {
|
|
return "nng";
|
|
}
|
|
|
|
std::string ErrorCategory::message(int ev) const {
|
|
return nng_strerror(ev);
|
|
}
|
|
|
|
static const std::error_category &errorCategory() {
|
|
static ErrorCategory instance;
|
|
return instance;
|
|
}
|
|
|
|
std::error_code makeErrorCode(int code) {
|
|
return {code, errorCategory()};
|
|
}
|
|
|
|
} // namespace Nng
|