Cryptolens Client API for C++
ActivateError.hpp
1 #pragma once
2 
3 #include <exception>
4 
5 namespace cryptolens_io {
6 
7 namespace v20190401 {
8 
9 class ActivateError : public std::exception {
10 private:
11  ActivateError(int reason);
12 
13  int reason_;
14 public:
15  static const int UNKNOWN_SERVER_REPLY = 0;
16  static const int INVALID_ACCESS_TOKEN = 1;
17  static const int ACCESS_DENIED = 2;
18  static const int INCORRECT_INPUT_PARAMETER = 3;
19  static const int PRODUCT_NOT_FOUND = 4;
20  static const int KEY_NOT_FOUND = 5;
21  static const int KEY_BLOCKED = 6;
22  static const int DEVICE_LIMIT_REACHED = 7;
23 
24  static ActivateError from_reason(int reason);
25 
26  static ActivateError from_server_response(char const* server_response);
27 
28  int get_reason() const noexcept;
29 
30  virtual const char * what() const noexcept;
31 };
32 
33 } // namespace v20190401
34 
35 namespace v20180502 {
36 
37 using ::cryptolens_io::v20190401::ActivateError;
38 
39 } // namespace v20180502
40 
41 namespace latest {
42 
43 using ::cryptolens_io::v20190401::ActivateError;
44 
45 } // namespace latest
46 
47 } // namespace cryptolens_io
Definition: ActivateError.hpp:9
Definition: ActivateError.hpp:5