CPPKiteConnect
kiteconnect::kiteppException Class Referenceabstract

CPPKiteConnect saves you the hassle of detecting API errors by manually checking HTTP codes or JSON error responses. It raises appropriately named exceptions. kiteppException is derived from std::exception, provides code(), message() methods and inherits the what() method. All kitepp exceptions barring one are derived from this class. Most of the times, this is the exception class you'll want to catch. More...

#include <exceptions.hpp>

Inheritance diagram for kiteconnect::kiteppException:
Collaboration diagram for kiteconnect::kiteppException:

Public Member Functions

 kiteppException (int Code_, string Message_)
 
const char * what () const noexcept override=0
 Provides short descripion of the error. More...
 
int code () const noexcept
 Get HTTP code sent by the REST API. More...
 
const char * message () const noexcept
 Get error message sent by the REST API. More...
 

Detailed Description

CPPKiteConnect saves you the hassle of detecting API errors by manually checking HTTP codes or JSON error responses. It raises appropriately named exceptions. kiteppException is derived from std::exception, provides code(), message() methods and inherits the what() method. All kitepp exceptions barring one are derived from this class. Most of the times, this is the exception class you'll want to catch.

Attention
libExcpetion isn't derived from kiteppException.

example

} catch (kc::kiteppException& e) {
std::cerr << e.what() << ", " << e.code() << ", " << e.message()
<< '\n';
} catch (kc::libException& e) {
std::cerr << e.what() << '\n';
}

Member Function Documentation

◆ code()

int kiteconnect::kiteppException::code ( ) const
inlinenoexcept

Get HTTP code sent by the REST API.

Returns
int HTTP code

◆ message()

const char* kiteconnect::kiteppException::message ( ) const
inlinenoexcept

Get error message sent by the REST API.

Returns
const char* error message

◆ what()

const char* kiteconnect::kiteppException::what ( ) const
overridepure virtualnoexcept

The documentation for this class was generated from the following file:
kiteconnect::libException
This exception is thrown when an error occures at the library level.
Definition: exceptions.hpp:206
kiteconnect::kiteppException
CPPKiteConnect saves you the hassle of detecting API errors by manually checking HTTP codes or JSON e...
Definition: exceptions.hpp:50
kiteconnect::kiteppException::code
int code() const noexcept
Get HTTP code sent by the REST API.
Definition: exceptions.hpp:68
kiteconnect::kiteppException::message
const char * message() const noexcept
Get error message sent by the REST API.
Definition: exceptions.hpp:75
kiteconnect::kiteppException::what
const char * what() const noexcept override=0
Provides short descripion of the error.
kiteconnect::libException::what
const char * what()
Provides short description of the error.
Definition: exceptions.hpp:216