]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/auth/Errors.h
update download target update for octopus release
[ceph.git] / ceph / src / crimson / auth / Errors.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 namespace ceph::auth {
7
8 enum class error {
9 success = 0,
10 key_not_found,
11 invalid_key,
12 unknown_service, // no ticket handler for required service
13 };
14
15 const std::error_category& auth_category();
16
17 inline std::error_code make_error_code(error e)
18 {
19 return {static_cast<int>(e), auth_category()};
20 }
21
22 inline std::error_condition make_error_condition(error e)
23 {
24 return {static_cast<int>(e), auth_category()};
25 }
26
27 class auth_error : public std::runtime_error {};
28
29 } // namespace ceph::auth
30
31 namespace std {
32
33 /// enables implicit conversion to std::error_condition
34 template <>
35 struct is_error_condition_enum<ceph::auth::error> : public true_type {};
36
37 } // namespace std