NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CCassandraException Class Reference

Search Toolkit Book for CCassandraException

#include <objtools/pubseq_gateway/impl/cassandra/cass_exception.hpp>

+ Inheritance diagram for CCassandraException:
+ Collaboration diagram for CCassandraException:

Public Types

enum  EErrCode {
  eUnknown = 2000 , eRsrcFailed , eFailedToConn , eConnTimeout ,
  eQueryFailedRestartable , eQueryFailed , eBindFailed , eQueryTimeout ,
  eFetchFailed , eExtraFetch , eConvFailed , eMissData ,
  eInconsistentData , eNotFound , eSeqFailed , eFatal ,
  eGeneric , eMemory , eUserCancelled
}
 
- Public Types inherited from CException
enum  EErrCode { eInvalid = -1 , eUnknown = 0 }
 Error types that an application can generate. More...
 
enum  EFlags { fConsole = (1 << 0) }
 Miscellaneous generic hints, flags and attributes. More...
 
typedef int TErrCode
 
typedef int TFlags
 

Public Member Functions

void SetErrorCode (EErrCode error_code)
 
const char * GetErrCodeString (void) const override
 Get error code interpreted as text. More...
 
void SetOpTime (int64_t optimeMS)
 
int64_t GetOpTime (void) const
 
string TimeoutMsg (void) const
 
 NCBI_EXCEPTION_DEFAULT (CCassandraException, CException)
 
- Public Member Functions inherited from CException
 CException (const CDiagCompileInfo &info, const CException *prev_exception, EErrCode err_code, const string &message, EDiagSev severity=eDiag_Error, TFlags flags=0)
 Constructor. More...
 
 CException (const CDiagCompileInfo &info, const CException *prev_exception, const CExceptionArgs< EErrCode > &args, const string &message)
 
 CException (const CException &other)
 Copy constructor. More...
 
void AddBacklog (const CDiagCompileInfo &info, const string &message, EDiagSev severity=eDiag_Error)
 Add a message to backlog (to re-throw the same exception then). More...
 
void AddPrevious (const CException *prev_exception)
 
void AddToMessage (const string &add_msg)
 
virtual void Throw (void) const
 Polymorphically (re)throw an exception whose exact type is uncertain. More...
 
virtual const char * what (void) const noexcept
 Standard report (includes full backlog). More...
 
void Report (const CDiagCompileInfo &info, const string &title, CExceptionReporter *reporter=0, TDiagPostFlags flags=eDPF_Exception) const
 Report the exception. More...
 
string ReportThis (TDiagPostFlags flags=eDPF_Exception) const
 Report this exception only. More...
 
string ReportAll (TDiagPostFlags flags=eDPF_Exception) const
 Report all exceptions. More...
 
void ReportStd (ostream &out, TDiagPostFlags flags=eDPF_Exception) const
 Report "standard" attributes. More...
 
virtual void ReportExtra (ostream &out) const
 Report "non-standard" attributes. More...
 
const CStackTraceGetStackTrace (void) const
 Get the saved stack trace if available or NULL. More...
 
EDiagSev GetSeverity (void) const
 Get exception severity. More...
 
CExceptionSetSeverity (EDiagSev severity)
 Set exception severity. More...
 
virtual const char * GetType (void) const
 Get class name as a string. More...
 
const stringGetFile (void) const
 Get file name used for reporting. More...
 
void SetModule (const string &module)
 Set module name used for reporting. More...
 
const stringGetModule (void) const
 Get module name used for reporting. More...
 
void SetClass (const string &nclass)
 Set class name used for reporting. More...
 
const stringGetClass (void) const
 Get class name used for reporting. More...
 
void SetFunction (const string &function)
 Set function name used for reporting. More...
 
const stringGetFunction (void) const
 Get function name used for reporting. More...
 
int GetLine (void) const
 Get line number where error occurred. More...
 
TErrCode GetErrCode (void) const
 Get error code. More...
 
const stringGetMsg (void) const
 Get message string. More...
 
const CExceptionGetPredecessor (void) const
 Get "previous" exception from the backlog. More...
 
bool HasMainText (void) const
 Check if exception has main text in the chain. More...
 
virtual ~CException (void) noexcept
 Destructor. More...
 
bool IsSetFlag (EFlags flag) const
 Check if the flag is set. More...
 
CExceptionSetFlag (EFlags flag)
 Set flag (add to other flags) More...
 
CExceptionUnsetFlag (EFlags flag)
 Unset flag (other flags are left as is) More...
 
CRequestContextGetRequestContext (void) const
 Get the request context in which the exception was thrown. More...
 
void SetRetriable (ERetriable retriable)
 Set the info about ability to retry an action caused the exception. More...
 
virtual ERetriable GetRetriable (void) const
 Retrieve info about ability to retry an action caused the exception. More...
 

Static Public Member Functions

static CCassandraException s_ProduceException (CassFuture *future, CCassandraException::EErrCode error_code)
 
- Static Public Member Functions inherited from CException
static bool EnableBackgroundReporting (bool enable)
 Enable background reporting. More...
 
static void SetStackTraceLevel (EDiagSev level)
 Set severity level for saving and printing stack trace. More...
 
static EDiagSev GetStackTraceLevel (void)
 Get current severity level for saving and printing stack trace. More...
 

Protected Member Functions

void x_Init (const CDiagCompileInfo &info, const string &message, const CException *prev_exception, EDiagSev severity) override
 Helper method for initializing exception data. More...
 
void x_Assign (const CException &src) override
 Helper method for copying exception data. More...
 
- Protected Member Functions inherited from CException
 CException (const CDiagCompileInfo &info, const CException *prev_exception, const string &message, EDiagSev severity=eDiag_Error, TFlags flags=0)
 Constructor for derived classes. More...
 
 CException (void)
 Constructor with no arguments. More...
 
virtual void x_ReportToDebugger (void) const
 Helper method for reporting to the system debugger. More...
 
virtual const CExceptionx_Clone (void) const
 Helper method for cloning the exception. More...
 
virtual void x_InitArgs (const CExceptionArgs_Base &args)
 Process additional arguments. More...
 
virtual void x_AssignErrCode (const CException &src)
 Helper method for assigning error code. More...
 
virtual void x_InitErrCode (CException::EErrCode err_code)
 Helper method for initializing error code. More...
 
virtual int x_GetErrCode (void) const
 Helper method for getting error code. More...
 
void x_GetStackTrace (void)
 Get and store current stack trace. More...
 
void x_ThrowSanityCheck (const type_info &expected_type, const char *human_name) const
 Warn if Throw() will end up slicing its invocant. More...
 

Protected Attributes

int64_t m_OpTimeMs {0}
 

Detailed Description

Definition at line 48 of file cass_exception.hpp.

Member Enumeration Documentation

◆ EErrCode

Enumerator
eUnknown 
eRsrcFailed 
eFailedToConn 
eConnTimeout 
eQueryFailedRestartable 
eQueryFailed 
eBindFailed 
eQueryTimeout 
eFetchFailed 
eExtraFetch 
eConvFailed 
eMissData 
eInconsistentData 
eNotFound 
eSeqFailed 
eFatal 
eGeneric 
eMemory 
eUserCancelled 

Definition at line 51 of file cass_exception.hpp.

Member Function Documentation

◆ GetErrCodeString()

const char* CCassandraException::GetErrCodeString ( void  ) const
inlineoverridevirtual

◆ GetOpTime()

int64_t CCassandraException::GetOpTime ( void  ) const
inline

Definition at line 123 of file cass_exception.hpp.

References m_OpTimeMs.

◆ NCBI_EXCEPTION_DEFAULT()

CCassandraException::NCBI_EXCEPTION_DEFAULT ( CCassandraException  ,
CException   
)

◆ s_ProduceException()

static CCassandraException CCassandraException::s_ProduceException ( CassFuture *  future,
CCassandraException::EErrCode  error_code 
)
inlinestatic

Definition at line 75 of file cass_exception.hpp.

References eUnknown, NCBI_EXCEPTION, NStr::NumericToString(), and result.

◆ SetErrorCode()

void CCassandraException::SetErrorCode ( EErrCode  error_code)
inline

Definition at line 87 of file cass_exception.hpp.

References CException::x_InitErrCode().

◆ SetOpTime()

void CCassandraException::SetOpTime ( int64_t  optimeMS)
inline

Definition at line 118 of file cass_exception.hpp.

References m_OpTimeMs.

◆ TimeoutMsg()

string CCassandraException::TimeoutMsg ( void  ) const
inline

Definition at line 128 of file cass_exception.hpp.

References m_OpTimeMs, and NStr::NumericToString().

Referenced by CCassConnection::Perform().

◆ x_Assign()

void CCassandraException::x_Assign ( const CException src)
inlineoverrideprotectedvirtual

Helper method for copying exception data.

Reimplemented from CException.

Definition at line 147 of file cass_exception.hpp.

References m_OpTimeMs, and CException::x_Assign().

◆ x_Init()

void CCassandraException::x_Init ( const CDiagCompileInfo info,
const string message,
const CException prev_exception,
EDiagSev  severity 
)
inlineoverrideprotectedvirtual

Helper method for initializing exception data.

Reimplemented from CException.

Definition at line 137 of file cass_exception.hpp.

References ERR_POST, Info(), info, m_OpTimeMs, and CException::x_Init().

Member Data Documentation

◆ m_OpTimeMs

int64_t CCassandraException::m_OpTimeMs {0}
protected

Definition at line 156 of file cass_exception.hpp.

Referenced by GetOpTime(), SetOpTime(), TimeoutMsg(), x_Assign(), and x_Init().


The documentation for this class was generated from the following file:
Modified on Fri Feb 23 11:50:34 2024 by modify_doxy.py rev. 669887