retdec-cpp
exceptions.h
Go to the documentation of this file.
1 
8 #ifndef RETDEC_EXCEPTIONS_H
9 #define RETDEC_EXCEPTIONS_H
10 
11 #include <stdexcept>
12 #include <string>
13 
14 namespace retdec {
15 
19 class Error: public std::runtime_error {
20 public:
21  using std::runtime_error::runtime_error;
22 };
23 
27 class IoError: public Error {
28 public:
29  using Error::Error;
30 };
31 
35 class FilesystemError: public IoError {
36 public:
37  using IoError::IoError;
38 };
39 
43 class ConnectionError: public IoError {
44 public:
45  using IoError::IoError;
46 };
47 
51 class ApiError: public Error {
52 public:
53  ApiError(int code, const std::string &message,
54  const std::string &description = "");
55 
56  int getCode() const noexcept;
57  std::string getMessage() const;
58  std::string getDescription() const;
59 
60 private:
62  const int code;
63 
65  const std::string message;
66 
68  const std::string description;
69 };
70 
74 class AuthError: public ApiError {
75 public:
76  using ApiError::ApiError;
77 };
78 
82 class ResourceError: public Error {
83 public:
84  using Error::Error;
85 };
86 
91 public:
92  using ResourceError::ResourceError;
93 };
94 
99 public:
100  using ResourceError::ResourceError;
101 };
102 
103 } // namespace retdec
104 
105 #endif
Exception thrown when there is a filesystem error.
Definition: exceptions.h:35
The namespace of the library.
Definition: doxygen.h:8
Exception thrown when there is a connection error.
Definition: exceptions.h:43
ApiError(int code, const std::string &message, const std::string &description="")
Creates an exception.
Definition: exceptions.cpp:19
Exception thrown when there is an I/O error.
Definition: exceptions.h:27
Base class of resource exceptions.
Definition: exceptions.h:82
Exception thrown when an analysis fails.
Definition: exceptions.h:98
Exception thrown when a decompilation fails.
Definition: exceptions.h:90
Exception thrown when there is an authentication or authorization error.
Definition: exceptions.h:74
Base class of custom exceptions thrown by the library.
Definition: exceptions.h:19
Exception thrown when the API is used incorrectly.
Definition: exceptions.h:51