Amber Web Authorization Framework
API DocumentationError Class
(Amber::Web::Authorization::Error)Encapsulates an error which occurred during an OAuth operation More...
Header: | #include <Error> |
Public Types
enum | Code { NoError, InvalidOperationError, InvalidParametersError, StateMismatchError, ..., OtherError } |
Properties
Public Functions
Error() | |
Error(Code code, const QString &message, int httpCode = 0) | |
Error(const Error &other) | |
~Error() | |
Code | code() const |
int | httpCode() const |
QString | message() const |
Error & | operator=(const Error &other) |
Detailed Description
Encapsulates an error which occurred during an OAuth operation
This simple Q_GADGET class provides access to three members: code
, message
, and httpCode
.
Member Type Documentation
enum Error::Code
This enum defines the types of errors which may be encountered by an OAuth helper.
Constant | Value | Description |
---|---|---|
Amber::Web::Authorization::Error::NoError | 0 | No error occurred, the operation succeeded |
Amber::Web::Authorization::Error::InvalidOperationError | 1 | The specified operation is not valid for the currently selected flow type |
Amber::Web::Authorization::Error::InvalidParametersError | 2 | The client application has not set the appropriate properties required for the operation |
Amber::Web::Authorization::Error::StateMismatchError | 3 | The state data does not match the expected state, possibly due to a man-in-the-middle attack |
Amber::Web::Authorization::Error::NetworkError | 4 | The helper was unable to perform the request to the remote service |
Amber::Web::Authorization::Error::SslError | 5 | The request to the remote service failed due to an SSL error |
Amber::Web::Authorization::Error::HttpError | 6 | The request to the remote service failed due to a HTTP error (or server-side authorization error) |
Amber::Web::Authorization::Error::ParseError | 7 | The result of the request could not be parsed successfully |
Amber::Web::Authorization::Error::TimedOutError | 8 | The timeout was reached while waiting for redirect |
Amber::Web::Authorization::Error::OtherError | 9 | The operation failed for some other reason |
See also Amber::Web::Authorization::Error::code.
Property Documentation
code : const Code
This property holds this property holds the error code associated with the most recent failed operation.
Access functions:
Code | code() const |
See also Amber::Web::Authorization::Error::Code.
httpCode : const int
This property holds this property holds the HTTP error code associated with the most recent failed operation.
If the code
property value is HttpError
then a value will be set for this property.
Access functions:
int | httpCode() const |
message : const QString
This property holds this property holds the error message associated with the most recent failed operation.
The message is not translated or user-friendly, but is intended for developer consumption only.
It may contain sensitive information, and as such it should not be logged persistently.
Access functions:
QString | message() const |
Member Function Documentation
Error::Error()
Constructs a new, empty error object
Error::Error(Code code, const QString &message, int httpCode = 0)
Constructs a new error object with the given code, message, and httpCode set
Error::Error(const Error &other)
Constructs a copy of the other error object
Error::~Error()
Destroys the error object
Error &Error::operator=(const Error &other)
Sets this error's code, message, and httpCode equal to that of the other error object.