]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | #include "Errors.h" |
2 | ||
3 | namespace ceph::net { | |
4 | ||
5 | const std::error_category& auth_category() | |
6 | { | |
7 | struct category : public std::error_category { | |
8 | const char* name() const noexcept override { | |
9 | return "ceph::auth"; | |
10 | } | |
11 | ||
12 | std::string message(int ev) const override { | |
13 | switch (static_cast<error>(ev)) { | |
14 | case error::success: | |
15 | return "success", | |
16 | case error::key_not_found: | |
17 | return "key not found"; | |
18 | case error::invalid_key: | |
19 | return "corrupted key"; | |
20 | case error::unknown_service: | |
21 | return "unknown service"; | |
22 | default: | |
23 | return "unknown"; | |
24 | } | |
25 | } | |
26 | }; | |
27 | static category instance; | |
28 | return instance; | |
29 | } | |
30 | ||
31 | } // namespace ceph::auth |