MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
shcore::polyglot::Polyglot_error Class Reference

Represents polyglot errors that will be created from information available in the polyglot library state, it handles cases like: More...

#include <polyglot_error.h>

Inheritance diagram for shcore::polyglot::Polyglot_error:
[legend]

Public Member Functions

 Polyglot_error (poly_thread thread, int64_t rc)
 
 Polyglot_error (poly_thread thread, poly_exception exc)
 
std::string format (bool include_location=false) const
 
bool is_interrupted () const
 
bool is_resource_exhausted () const
 
bool is_syntax_error () const
 
shcore::Dictionary_t data () const
 
std::optional< std::string > type () const
 
std::optional< uint64_t > line () const
 
std::optional< uint64_t > column () const
 
std::optional< std::string > source_line () const
 
std::optional< int64_t > code () const
 
std::optional< std::string > source () const
 
std::vector< std::string > backtrace () const
 
- Public Member Functions inherited from shcore::polyglot::Polyglot_generic_error
 Polyglot_generic_error (const std::string &msg)
 
const char * what () const noexcept override
 
const std::string & message () const
 

Private Member Functions

void parse_and_translate (const std::string &source)
 This function is used to normalize as much as possible the exceptions, i.e. More...
 
void initialize (poly_thread thread, poly_exception exc)
 
void initialize (poly_thread thread)
 
void set_message (const std::string &msg) override
 

Private Attributes

std::optional< std::string > m_type
 
std::optional< size_t > m_line
 
std::optional< size_t > m_column
 
std::optional< std::string > m_source_line
 
std::optional< int64_t > m_code
 
std::optional< std::string > m_source
 
std::vector< std::string > m_backtrace
 
bool m_interrupted = false
 
bool m_resource_exhausted = false
 

Additional Inherited Members

- Protected Member Functions inherited from shcore::polyglot::Polyglot_generic_error
 Polyglot_generic_error ()=default
 

Detailed Description

Represents polyglot errors that will be created from information available in the polyglot library state, it handles cases like:

  • poly_get_last_error_info
  • poly_exception_is_interrupted
  • poly_exception_has_object: like error objects from the shcore::Exception

Constructor & Destructor Documentation

◆ Polyglot_error() [1/2]

shcore::polyglot::Polyglot_error::Polyglot_error ( poly_thread  thread,
int64_t  rc 
)

◆ Polyglot_error() [2/2]

shcore::polyglot::Polyglot_error::Polyglot_error ( poly_thread  thread,
poly_exception  exc 
)

Member Function Documentation

◆ backtrace()

std::vector< std::string > shcore::polyglot::Polyglot_error::backtrace ( ) const
inline

◆ code()

std::optional< int64_t > shcore::polyglot::Polyglot_error::code ( ) const
inline

◆ column()

std::optional< uint64_t > shcore::polyglot::Polyglot_error::column ( ) const
inline

◆ data()

shcore::Dictionary_t shcore::polyglot::Polyglot_error::data ( ) const

◆ format()

std::string shcore::polyglot::Polyglot_error::format ( bool  include_location = false) const

◆ initialize() [1/2]

void shcore::polyglot::Polyglot_error::initialize ( poly_thread  thread)
private

◆ initialize() [2/2]

void shcore::polyglot::Polyglot_error::initialize ( poly_thread  thread,
poly_exception  exc 
)
private

◆ is_interrupted()

bool shcore::polyglot::Polyglot_error::is_interrupted ( ) const
inline

◆ is_resource_exhausted()

bool shcore::polyglot::Polyglot_error::is_resource_exhausted ( ) const
inline

◆ is_syntax_error()

bool shcore::polyglot::Polyglot_error::is_syntax_error ( ) const

◆ line()

std::optional< uint64_t > shcore::polyglot::Polyglot_error::line ( ) const
inline

◆ parse_and_translate()

void shcore::polyglot::Polyglot_error::parse_and_translate ( const std::string &  source)
private

This function is used to normalize as much as possible the exceptions, i.e.

to try getting as much as possible the separate components for future unified formatting

◆ set_message()

void shcore::polyglot::Polyglot_error::set_message ( const std::string &  msg)
overrideprivatevirtual

◆ source()

std::optional< std::string > shcore::polyglot::Polyglot_error::source ( ) const
inline

◆ source_line()

std::optional< std::string > shcore::polyglot::Polyglot_error::source_line ( ) const
inline

◆ type()

std::optional< std::string > shcore::polyglot::Polyglot_error::type ( ) const
inline

Member Data Documentation

◆ m_backtrace

std::vector<std::string> shcore::polyglot::Polyglot_error::m_backtrace
private

◆ m_code

std::optional<int64_t> shcore::polyglot::Polyglot_error::m_code
private

◆ m_column

std::optional<size_t> shcore::polyglot::Polyglot_error::m_column
private

◆ m_interrupted

bool shcore::polyglot::Polyglot_error::m_interrupted = false
private

◆ m_line

std::optional<size_t> shcore::polyglot::Polyglot_error::m_line
private

◆ m_resource_exhausted

bool shcore::polyglot::Polyglot_error::m_resource_exhausted = false
private

◆ m_source

std::optional<std::string> shcore::polyglot::Polyglot_error::m_source
private

◆ m_source_line

std::optional<std::string> shcore::polyglot::Polyglot_error::m_source_line
private

◆ m_type

std::optional<std::string> shcore::polyglot::Polyglot_error::m_type
private

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