Exception caused by a Hue API "error" response with additional information.
More...
#include <hueplusplus/HueException.h>
|
| HueAPIResponseException (FileInfo fileInfo, int error, std::string address, std::string description) |
| Create exception with info from Hue API error.
|
|
int | GetErrorNumber () const noexcept |
| Error number from Hue API error response.
|
|
const std::string & | GetAddress () const noexcept |
| Address the API call tried to access.
|
|
const std::string & | GetDescription () const noexcept |
| Error description.
|
|
| HueException (FileInfo fileInfo, const std::string &message) |
| Creates HueException with information about the error and source.
|
|
const char * | what () const noexcept override |
| What message of the exception.
|
|
const FileInfo & | GetFile () const noexcept |
| Filename and line where the exception was thrown or caused by.
|
|
Exception caused by a Hue API "error" response with additional information.
Refer to Hue developer documentation for more detail on specific error codes.
◆ HueAPIResponseException()
hueplusplus::HueAPIResponseException::HueAPIResponseException |
( |
FileInfo |
fileInfo, |
|
|
int |
error, |
|
|
std::string |
address, |
|
|
std::string |
description |
|
) |
| |
Create exception with info from Hue API error.
- Parameters
-
fileInfo | Source of the error. Must not always be the throw location, can also be a calling function which matches the cause better. |
error | Hue API error code from error response. |
address | URI the API call referred to from error response. |
description | Error description from response. |
◆ Create()
Creates exception from API response.
- Parameters
-
fileInfo | Location of the cause |
response | Hue API response. Must contain a member "error" with "type", "address" and "description". |
- Returns
- HueAPIResponseException with info from the response. If response does not contain the required members, they are defaulted to -1 or "".
◆ GetAddress()
const std::string & hueplusplus::HueAPIResponseException::GetAddress |
( |
| ) |
const |
|
noexcept |
Address the API call tried to access.
◆ GetDescription()
const std::string & hueplusplus::HueAPIResponseException::GetDescription |
( |
| ) |
const |
|
noexcept |
◆ GetErrorNumber()
int hueplusplus::HueAPIResponseException::GetErrorNumber |
( |
| ) |
const |
|
noexcept |
Error number from Hue API error response.
Refer to Hue developer documentation for meaning of error codes.
The documentation for this class was generated from the following files: