-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror.hpp
More file actions
28 lines (22 loc) · 735 Bytes
/
Copy patherror.hpp
File metadata and controls
28 lines (22 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef POLYWEB_ERROR_HPP_
#define POLYWEB_ERROR_HPP_
#include "Polynet/error.hpp"
namespace pw {
enum ErrorType {
PW_ERROR_INVALID_URL,
PW_ERROR_INVALID_HTTP,
PW_ERROR_INVALID_WS,
PW_ERROR_LIMIT_EXCEEDED,
PW_ERROR_UNSUPPORTED,
PW_ERROR_PROXY_CONNECT_REJECTED,
PW_ERROR_WS_HANDSHAKE_REJECTED,
};
const std::error_category& polyweb_category() noexcept;
inline std::error_code polyweb_error_code(ErrorType error) noexcept {
return {error, polyweb_category()};
}
inline pn::Error make_polyweb_error(ErrorType error, pn::StringView operation = {}) noexcept {
return {polyweb_error_code(error), operation};
}
} // namespace pw
#endif