10Duke Scale C++ Client
Loading...
Searching...
No Matches
OAuthException.h
1#ifndef TENDUKE_OAUTH_OAUTHEXCEPTION_H
2#define TENDUKE_OAUTH_OAUTHEXCEPTION_H
3
4#include "TendukeException.h"
5
6#include <string>
7
8namespace tenduke { namespace oauth {
9
10
15{
16public:
20 enum Phase
21 {
22 NONE,
23 AUTHORIZATION,
24 TOKEN_REQUEST,
25 REFRESH_REQUEST
26 };
27
35 Phase phase,
36 std::string error,
37 const std::string &errorDescription
38 ) : tenduke::TendukeException(errorDescription), phase(phase), error(std::move(error))
39 {}
40
45 Phase getPhase() const {return phase;}
50 std::string getError() const {return error;}
55 std::string getErrorDescription() const {return what();}
56
57private:
58 const Phase phase;
59 const std::string error;
60};
61
62
63}}
64
65#endif // TENDUKE_OAUTH_OAUTHEXCEPTION_H
Base class for exceptions thrown by 10Duke C++ clients.
Definition TendukeException.h:13
Generic OAuth-related exception.
Definition OAuthException.h:15
std::string getErrorDescription() const
Error description.
Definition OAuthException.h:55
std::string getError() const
Error code.
Definition OAuthException.h:50
Phase getPhase() const
The phase where this exception occurred.
Definition OAuthException.h:45
Phase
Phase where this exception occurred.
Definition OAuthException.h:21
OAuthException(Phase phase, std::string error, const std::string &errorDescription)
Constructs new instance.
Definition OAuthException.h:34
OAuth services.
Definition AccessTokenRequestAuthenticator.h:8
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7