MySQL 9.1.0
Source Code Documentation
mysql::utils::Error Class Reference

Error representation used internally in case final error code is unknown and error situation handling needs to be done by the caller. More...

#include <error.h>

Inheritance diagram for mysql::utils::Error:
[legend]

Public Member Functions

 Error ()=default
 
 Error (const char *type, const char *file, std::size_t line)
 Constructor. More...
 
 Error (const char *type, const char *file, std::size_t line, const char *message)
 Constructor. More...
 
bool is_error () const
 Function that indicates whether error occurred. More...
 
const char * what () const noexcept
 Information about error. More...
 
const char * get_message () const noexcept
 Returns only message, no other information. More...
 

Protected Attributes

std::stringstream m_stream
 Internal stream to build the message string. More...
 
std::string m_message
 Message ready to be displayed. More...
 
const char * m_user_message
 Only message. More...
 
bool m_is_error = false
 object state, "false" means "no error" More...
 

Detailed Description

Error representation used internally in case final error code is unknown and error situation handling needs to be done by the caller.

Constructor & Destructor Documentation

◆ Error() [1/3]

mysql::utils::Error::Error ( )
default

◆ Error() [2/3]

mysql::utils::Error::Error ( const char *  type,
const char *  file,
std::size_t  line 
)
inline

Constructor.

Parameters
[in]typeInformation about error type
[in]fileFile name in which error occurred
[in]lineLine number in which error occurred

◆ Error() [3/3]

mysql::utils::Error::Error ( const char *  type,
const char *  file,
std::size_t  line,
const char *  message 
)
inline

Constructor.

Parameters
[in]typeInformation about error type
[in]fileFile name in which error occurred
[in]lineLine number in which error occurred
[in]messageAdditional information

Member Function Documentation

◆ get_message()

const char * mysql::utils::Error::get_message ( ) const
inlinenoexcept

Returns only message, no other information.

Returns
Message const string

◆ is_error()

bool mysql::utils::Error::is_error ( ) const
inline

Function that indicates whether error occurred.

◆ what()

const char * mysql::utils::Error::what ( ) const
inlinenoexcept

Information about error.

Returns
Message const string

Member Data Documentation

◆ m_is_error

bool mysql::utils::Error::m_is_error = false
protected

object state, "false" means "no error"

◆ m_message

std::string mysql::utils::Error::m_message
protected

Message ready to be displayed.

◆ m_stream

std::stringstream mysql::utils::Error::m_stream
protected

Internal stream to build the message string.

◆ m_user_message

const char* mysql::utils::Error::m_user_message
protected

Only message.


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