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::CatalogException Class Reference
Inheritance diagram for duckdb::CatalogException:
Collaboration diagram for duckdb::CatalogException:

Public Member Functions

DUCKDB_API CatalogException (const string &msg)
 
DUCKDB_API CatalogException (const unordered_map< string, string > &extra_info, const string &msg)
 
template<typename... ARGS>
 CatalogException (const string &msg, ARGS &&...params)
 
template<typename... ARGS>
 CatalogException (QueryErrorContext error_context, 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

static CatalogException MissingEntry (const EntryLookupInfo &lookup_info, const string &suggestion)
 
static CatalogException MissingEntry (CatalogType type, const string &name, const string &suggestion, QueryErrorContext context=QueryErrorContext())
 
static CatalogException MissingEntry (const string &type, const string &name, const vector< string > &suggestions, QueryErrorContext context=QueryErrorContext())
 
static CatalogException EntryAlreadyExists (CatalogType type, const string &name, QueryErrorContext context=QueryErrorContext())
 
- 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

◆ CatalogException() [1/4]

duckdb::CatalogException::CatalogException ( const string &  msg)
explicit
70398 : Exception(ExceptionType::CATALOG, msg) {
70399}

◆ CatalogException() [2/4]

duckdb::CatalogException::CatalogException ( const unordered_map< string, string > &  extra_info,
const string &  msg 
)
explicit
70402 : Exception(extra_info, ExceptionType::CATALOG, msg) {
70403}

◆ CatalogException() [3/4]

template<typename... ARGS>
duckdb::CatalogException::CatalogException ( const string &  msg,
ARGS &&...  params 
)
inlineexplicit
2644 : CatalogException(ConstructMessage(msg, std::forward<ARGS>(params)...)) {
2645 }

◆ CatalogException() [4/4]

template<typename... ARGS>
duckdb::CatalogException::CatalogException ( QueryErrorContext  error_context,
const string &  msg,
ARGS &&...  params 
)
inlineexplicit
2649 : CatalogException(Exception::InitializeExtraInfo(error_context),
2650 ConstructMessage(msg, std::forward<ARGS>(params)...)) {
2651 }

Member Function Documentation

◆ MissingEntry() [1/3]

CatalogException duckdb::CatalogException::MissingEntry ( const EntryLookupInfo lookup_info,
const string &  suggestion 
)
static
70405 {
70406 auto type = lookup_info.GetCatalogType();
70407 auto context = lookup_info.GetErrorContext();
70408 auto &name = lookup_info.GetEntryName();
70409 auto at_clause = lookup_info.GetAtClause();
70410
70411 string did_you_mean;
70412 if (!suggestion.empty()) {
70413 did_you_mean = "\nDid you mean \"" + suggestion + "\"?";
70414 }
70415 string version_info;
70416 if (at_clause) {
70417 version_info += " at " + StringUtil::Lower(at_clause->Unit()) + " " + at_clause->GetValue().ToString();
70418 }
70419
70420 auto extra_info = Exception::InitializeExtraInfo("MISSING_ENTRY", context.query_location);
70421
70422 extra_info["name"] = name;
70423 extra_info["type"] = CatalogTypeToString(type);
70424 if (!suggestion.empty()) {
70425 extra_info["candidates"] = suggestion;
70426 }
70427 return CatalogException(extra_info,
70428 StringUtil::Format("%s with name %s does not exist%s!%s", CatalogTypeToString(type), name,
70429 version_info, did_you_mean));
70430}
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002

◆ MissingEntry() [2/3]

CatalogException duckdb::CatalogException::MissingEntry ( CatalogType  type,
const string &  name,
const string &  suggestion,
QueryErrorContext  context = QueryErrorContext() 
)
static
70433 {
70434 EntryLookupInfo lookup_info(type, name, context);
70435 return MissingEntry(lookup_info, suggestion);
70436}

◆ MissingEntry() [3/3]

CatalogException duckdb::CatalogException::MissingEntry ( const string &  type,
const string &  name,
const vector< string > &  suggestions,
QueryErrorContext  context = QueryErrorContext() 
)
static
70439 {
70440 auto extra_info = Exception::InitializeExtraInfo("MISSING_ENTRY", context.query_location);
70441 extra_info["error_subtype"] = "MISSING_ENTRY";
70442 extra_info["name"] = name;
70443 extra_info["type"] = type;
70444 if (!suggestions.empty()) {
70445 extra_info["candidates"] = StringUtil::Join(suggestions, ", ");
70446 }
70447 return CatalogException(extra_info,
70448 StringUtil::Format("unrecognized %s \"%s\"\n%s", type, name,
70449 StringUtil::CandidatesErrorMessage(suggestions, name, "Did you mean")));
70450}
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
static DUCKDB_API string CandidatesErrorMessage(const vector< string > &strings, const string &target, const string &message_prefix, idx_t n=5)

◆ EntryAlreadyExists()

CatalogException duckdb::CatalogException::EntryAlreadyExists ( CatalogType  type,
const string &  name,
QueryErrorContext  context = QueryErrorContext() 
)
static
70452 {
70453 auto extra_info = Exception::InitializeExtraInfo("ENTRY_ALREADY_EXISTS", optional_idx());
70454 extra_info["name"] = name;
70455 extra_info["type"] = CatalogTypeToString(type);
70456 return CatalogException(extra_info,
70457 StringUtil::Format("%s with name \"%s\" already exists!", CatalogTypeToString(type), name));
70458}

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