Fawkes API Fawkes Development Version
|
REST processing exception. More...
#include <rest_api.h>
Public Member Functions | |
WebviewRestException (WebReply::Code code, const char *format,...) | |
Constructor. More... | |
template<typename T , typename = std::enable_if_t<std::is_class<T>::value>> | |
WebviewRestException (WebReply::Code code, const T &o, bool pretty=false) | |
Constructor. More... | |
WebReply::Code | code () |
Get HTTP response code. More... | |
const std::string & | content_type () const |
Get content type of response. More... | |
![]() | |
Exception (const char *format,...) noexcept | |
Constructor. More... | |
Exception (int errnoval, const char *format,...) noexcept | |
Constructor. More... | |
Exception (const Exception &exc) noexcept | |
Copy constructor. More... | |
virtual | ~Exception () noexcept |
Destructor. More... | |
virtual void | raise () |
This can be used to throw this exception. More... | |
void | prepend (const char *format,...) noexcept |
Prepend messages to the message list. More... | |
void | append (const char *format,...) noexcept |
Append messages to the message list. More... | |
void | append_va (const char *format, va_list va) noexcept |
Append messages to the message list. More... | |
void | append (const Exception &e) noexcept |
Append message that are from another Exception. More... | |
void | print_trace () noexcept |
Prints trace to stderr. More... | |
void | print_backtrace () const noexcept |
Prints a backtrace. More... | |
char * | generate_backtrace () const noexcept |
Generate backtrace string. More... | |
int | get_errno () noexcept |
Get errno. More... | |
void | set_type_id (const char *id) |
Set exception type ID. More... | |
const char * | type_id () const |
Get type ID. More... | |
virtual const char * | what () const noexcept |
Get primary string. More... | |
virtual const char * | what_no_backtrace () const noexcept |
Get primary string (does not implicitly print the back trace). More... | |
Exception & | operator= (const Exception &exc) noexcept |
Assign an Exception. More... | |
iterator | begin () noexcept |
Get iterator for messages. More... | |
iterator | end () noexcept |
Get end iterator for messages. More... | |
Additional Inherited Members | |
![]() | |
Exception () noexcept | |
Constructor for subclasses. More... | |
void | append_nolock (const char *format,...) noexcept |
Append messages without lock. More... | |
void | append_nolock_va (const char *format, va_list va) noexcept |
Append messages without lock by formatted string. More... | |
void | append_nolock_nocopy (char *msg) noexcept |
Append message without copying. More... | |
void | prepend_nolock_va (const char *format, va_list va) noexcept |
Prepend messages without lock by formatted string. More... | |
void | copy_messages (const Exception &exc) noexcept |
Copy messages from given exception. More... | |
![]() | |
message_list_t * | messages |
List of messages. More... | |
message_list_t * | messages_iterator |
Iterator to iterate over messages. More... | |
message_list_t * | messages_end |
Pointer that points to the very last message. More... | |
Mutex * | messages_mutex |
Mutex to protect operations on messages list. More... | |
int | _errno |
Error number, should be used if the error was caused by a method that supplies errno. More... | |
REST processing exception.
Use to indicate failure with more specific response. The HTTP code will be used for the static response with the formatted error message.
Definition at line 70 of file rest_api.h.
|
inlineexplicit |
Constructor.
code | HTTP response code |
format | format string for error message (cf. printf) |
Definition at line 77 of file rest_api.h.
References fawkes::Exception::append_va().
|
inline |
Constructor.
code | HTTP response code |
o | Object to convert to JSON |
pretty | true to enable pretty printing of the JSON input |
Definition at line 92 of file rest_api.h.
References fawkes::Exception::append().
|
inline |
Get HTTP response code.
Definition at line 102 of file rest_api.h.
Referenced by fawkes::WebviewRestApi::add_handler().
|
inline |
Get content type of response.
Definition at line 111 of file rest_api.h.
Referenced by fawkes::WebviewRestApi::add_handler().