Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::HTTPException Class Reference
Inheritance diagram for duckdb::HTTPException:
Collaboration diagram for duckdb::HTTPException:

Classes

struct  ResponseShape
 
struct  ResponseWrapperShape
 

Public Member Functions

 HTTPException (const string &message)
 
template<class RESPONSE , typename ResponseShape< decltype(RESPONSE::status)>::status = 0, typename... ARGS>
 HTTPException (RESPONSE &response, const string &msg, ARGS &&...params)
 
template<class RESPONSE , typename ResponseWrapperShape< decltype(RESPONSE::code)>::code = 0, typename... ARGS>
 HTTPException (RESPONSE &response, const string &msg, ARGS &&...params)
 
template<class HEADERS , typename... ARGS>
 HTTPException (int status_code, const string &response_body, const HEADERS &headers, const string &reason, const string &msg, ARGS &&...params)
 
- Public Member Functions inherited from duckdb::Exception
DUCKDB_API Exception (ExceptionType exception_type, const string &message)
 
DUCKDB_API Exception (const unordered_map< string, string > &extra_info, ExceptionType exception_type, const string &message)
 

Static Public Member Functions

template<class HEADERS >
static unordered_map< string, string > HTTPExtraInfo (int status_code, const string &response_body, const HEADERS &headers, const string &reason)
 
- Static Public Member Functions inherited from duckdb::Exception
static DUCKDB_API string ExceptionTypeToString (ExceptionType type)
 
static DUCKDB_API ExceptionType StringToExceptionType (const string &type)
 
template<typename... ARGS>
static string ConstructMessage (const string &msg, ARGS const &...params)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (const Expression &expr)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (const ParsedExpression &expr)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (const QueryErrorContext &error_context)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (const TableRef &ref)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (optional_idx error_location)
 
static DUCKDB_API unordered_map< string, string > InitializeExtraInfo (const string &subtype, optional_idx error_location)
 
static DUCKDB_API bool IsExecutionError (ExceptionType type)
 Whether this exception type can occur during execution of a query.
 
static DUCKDB_API string ToJSON (ExceptionType type, const string &message)
 
static DUCKDB_API string ToJSON (const unordered_map< string, string > &extra_info, ExceptionType type, const string &message)
 
static DUCKDB_API bool InvalidatesTransaction (ExceptionType exception_type)
 
static DUCKDB_API bool InvalidatesDatabase (ExceptionType exception_type)
 
static DUCKDB_API string ConstructMessageRecursive (const string &msg, std::vector< ExceptionFormatValue > &values)
 
template<class T , typename... ARGS>
static string ConstructMessageRecursive (const string &msg, std::vector< ExceptionFormatValue > &values, const T &param, ARGS &&...params)
 
static DUCKDB_API bool UncaughtException ()
 
static DUCKDB_API string GetStackTrace (idx_t max_depth=120)
 
static string FormatStackTrace (const string &message="")
 
static DUCKDB_API void SetQueryLocation (optional_idx error_location, unordered_map< string, string > &extra_info)
 

Constructor & Destructor Documentation

◆ HTTPException() [1/4]

duckdb::HTTPException::HTTPException ( const string &  message)
inlineexplicit
70531 : Exception(ExceptionType::HTTP, message) {
70532 }

◆ HTTPException() [2/4]

template<class RESPONSE , typename ResponseShape< decltype(RESPONSE::status)>::status = 0, typename... ARGS>
duckdb::HTTPException::HTTPException ( RESPONSE response,
const string &  msg,
ARGS &&...  params 
)
inlineexplicit
70536 : HTTPException(static_cast<int>(response.status), response.body, response.headers, response.reason, msg,
70537 std::forward<ARGS>(params)...) {
70538 }

◆ HTTPException() [3/4]

template<class RESPONSE , typename ResponseWrapperShape< decltype(RESPONSE::code)>::code = 0, typename... ARGS>
duckdb::HTTPException::HTTPException ( RESPONSE response,
const string &  msg,
ARGS &&...  params 
)
inlineexplicit
70547 : HTTPException(static_cast<int>(response.code), response.body, response.headers, response.error, msg,
70548 std::forward<ARGS>(params)...) {
70549 }

◆ HTTPException() [4/4]

template<class HEADERS , typename... ARGS>
duckdb::HTTPException::HTTPException ( int  status_code,
const string &  response_body,
const HEADERS headers,
const string &  reason,
const string &  msg,
ARGS &&...  params 
)
inlineexplicit
70554 : Exception(HTTPExtraInfo(status_code, response_body, headers, reason), ExceptionType::HTTP,
70555 ConstructMessage(msg, std::forward<ARGS>(params)...)) {
70556 }

Member Function Documentation

◆ HTTPExtraInfo()

template<class HEADERS >
static unordered_map< string, string > duckdb::HTTPException::HTTPExtraInfo ( int  status_code,
const string &  response_body,
const HEADERS headers,
const string &  reason 
)
inlinestatic
70560 {
70561 unordered_map<string, string> extra_info;
70562 extra_info["status_code"] = to_string(status_code);
70563 extra_info["reason"] = reason;
70564 extra_info["response_body"] = response_body;
70565 for (auto &entry : headers) {
70566 extra_info["header_" + entry.first] = entry.second;
70567 }
70568 return extra_info;
70569 }

The documentation for this class was generated from the following file: