hueplusplus
1.0.0
|
Exception caused by a Hue API "error" response with additional information. More...
#include <hueplusplus/HueException.h>
Public Member Functions | |
HueAPIResponseException (FileInfo fileInfo, int error, std::string address, std::string description) | |
Create exception with info from Hue API error. More... | |
int | GetErrorNumber () const noexcept |
Error number from Hue API error response. More... | |
const std::string & | GetAddress () const noexcept |
Address the API call tried to access. More... | |
const std::string & | GetDescription () const noexcept |
Error description. More... | |
Public Member Functions inherited from hueplusplus::HueException | |
HueException (FileInfo fileInfo, const std::string &message) | |
Creates HueException with information about the error and source. More... | |
const char * | what () const noexcept override |
What message of the exception. More... | |
const FileInfo & | GetFile () const noexcept |
Filename and line where the exception was thrown or caused by. More... | |
Static Public Member Functions | |
static HueAPIResponseException | Create (FileInfo fileInfo, const nlohmann::json &response) |
Creates exception from API response. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from hueplusplus::HueException | |
HueException (const char *exceptionName, FileInfo fileInfo, const std::string &message) | |
Creates HueException with child class name. More... | |
Exception caused by a Hue API "error" response with additional information.
Refer to Hue developer documentation for more detail on specific error codes.
hueplusplus::HueAPIResponseException::HueAPIResponseException | ( | FileInfo | fileInfo, |
int | error, | ||
std::string | address, | ||
std::string | description | ||
) |
Create exception with info from Hue API error.
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. |
|
static |
Creates exception from API response.
fileInfo | Location of the cause |
response | Hue API response. Must contain a member "error" with "type", "address" and "description". |
|
noexcept |
Address the API call tried to access.
|
noexcept |
Error description.
|
noexcept |
Error number from Hue API error response.
Refer to Hue developer documentation for meaning of error codes.