GOG GALAXY SDK Documentation
Errors.h
Go to the documentation of this file.
1 #ifndef GALAXY_ERRORS_H
2 #define GALAXY_ERRORS_H
3 
9 #include "GalaxyExport.h"
10 
11 namespace galaxy
12 {
13  namespace api
14  {
23  class IError
24  {
25  public:
26 
27  virtual ~IError()
28  {
29  }
30 
36  virtual const char* GetName() const = 0;
37 
43  virtual const char* GetMsg() const = 0;
44 
48  enum Type
49  {
50  UNAUTHORIZED_ACCESS,
51  INVALID_ARGUMENT,
52  INVALID_STATE,
53  RUNTIME_ERROR
54  };
55 
61  virtual Type GetType() const = 0;
62  };
63 
69  {
70  };
71 
76  {
77  };
78 
83  class IInvalidStateError : public IError
84  {
85  };
86 
90  class IRuntimeError : public IError
91  {
92  };
93 
99  GALAXY_DLL_EXPORT const IError* GALAXY_CALLTYPE GetError();
100 
102  }
103 }
104 
105 #endif
Contains a macro used for DLL export.
Base interface for exceptions.
Definition: Errors.h:24
Type
Type of error.
Definition: Errors.h:49
virtual const char * GetMsg() const =0
Returns the error message.
virtual Type GetType() const =0
Returns the type of the error.
virtual const char * GetName() const =0
Returns the name of the error.
The exception thrown to report that a method was called with an invalid argument.
Definition: Errors.h:76
The exception thrown to report that a method was called while the callee is in an invalid state,...
Definition: Errors.h:84
The exception thrown to report errors that can only be detected during runtime.
Definition: Errors.h:91
The exception thrown when calling Galaxy interfaces while the user is not signed in and thus not auth...
Definition: Errors.h:69
GALAXY_DLL_EXPORT const IError *GALAXY_CALLTYPE GetError()
Retrieves error connected with the last API call on the local thread.