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

Search Toolkit Book for CImportError

#include <objtools/import/import_error.hpp>

+ Inheritance diagram for CImportError:
+ Collaboration diagram for CImportError:

Public Types

enum  ErrorLevel {
  PROGRESS = -1 , FATAL = 0 , CRITICAL = 1 , ERROR = 2 ,
  WARNING = 3 , DEBUG = 4 , NONE = 10
}
 
enum  ErrorCode { eUNSPECIFIED = 0 }
 
- 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

 CImportError (ErrorLevel, const std::string &, unsigned int=0, ErrorCode=eUNSPECIFIED)
 
CImportErroroperator= (const CImportError &rhs)
 
virtual ~CImportError ()
 
void SetLineNumber (unsigned int lineNumber)
 
void AmendMessage (const std::string &amend)
 
ErrorLevel Severity () const
 
std::string Message () const
 
unsigned int LineNumber () const
 
ErrorCode Code () const
 
string SeverityStr () const
 
void Serialize (CNcbiOstream &)
 
- 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...
 
virtual const char * GetErrCodeString (void) const
 Get error code interpreted as text. 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...
 

Protected Attributes

ErrorLevel mSeverity
 
ErrorCode mCode
 
string mMessage
 
string mAmend
 
unsigned int mLineNumber
 

Additional Inherited Members

- 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 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_Init (const CDiagCompileInfo &info, const string &message, const CException *prev_exception, EDiagSev severity)
 Helper method for initializing exception data. More...
 
virtual void x_InitArgs (const CExceptionArgs_Base &args)
 Process additional arguments. More...
 
virtual void x_Assign (const CException &src)
 Helper method for copying exception data. 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...
 

Detailed Description

Definition at line 45 of file import_error.hpp.

Member Enumeration Documentation

◆ ErrorCode

Enumerator
eUNSPECIFIED 

Definition at line 60 of file import_error.hpp.

◆ ErrorLevel

Enumerator
PROGRESS 
FATAL 
CRITICAL 
ERROR 
WARNING 
DEBUG 
NONE 

Definition at line 50 of file import_error.hpp.

Constructor & Destructor Documentation

◆ CImportError()

CImportError::CImportError ( ErrorLevel  severity,
const std::string message,
unsigned int  lineNumber = 0,
ErrorCode  code = eUNSPECIFIED 
)

Definition at line 39 of file import_error.cpp.

◆ ~CImportError()

virtual CImportError::~CImportError ( )
inlinevirtual

Definition at line 80 of file import_error.hpp.

Member Function Documentation

◆ AmendMessage()

void CImportError::AmendMessage ( const std::string amend)
inline

◆ Code()

ErrorCode CImportError::Code ( void  ) const
inline

Definition at line 93 of file import_error.hpp.

References mCode.

◆ LineNumber()

unsigned int CImportError::LineNumber ( ) const
inline

Definition at line 92 of file import_error.hpp.

References mLineNumber.

Referenced by CFeatImporter_impl::ReadSeqAnnot(), and Serialize().

◆ Message()

string CImportError::Message ( void  ) const

Definition at line 72 of file import_error.cpp.

References mAmend, and mMessage.

Referenced by Serialize().

◆ operator=()

CImportError& CImportError::operator= ( const CImportError rhs)
inline

Definition at line 72 of file import_error.hpp.

References mLineNumber, mMessage, and mSeverity.

◆ Serialize()

void CImportError::Serialize ( CNcbiOstream out)

Definition at line 85 of file import_error.cpp.

References LineNumber(), Message(), out(), and SeverityStr().

◆ SetLineNumber()

void CImportError::SetLineNumber ( unsigned int  lineNumber)
inline

Definition at line 83 of file import_error.hpp.

References mLineNumber.

Referenced by C5ColLineReader::GetNextRecord(), and CFeatImporter_impl::ReadSeqAnnot().

◆ Severity()

ErrorLevel CImportError::Severity ( void  ) const
inline

Definition at line 90 of file import_error.hpp.

References mSeverity.

Referenced by CFeatImporter_impl::ReadSeqAnnot().

◆ SeverityStr()

string CImportError::SeverityStr ( ) const

Definition at line 53 of file import_error.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), and mSeverity.

Referenced by Serialize().

Member Data Documentation

◆ mAmend

string CImportError::mAmend
protected

Definition at line 106 of file import_error.hpp.

Referenced by AmendMessage(), and Message().

◆ mCode

ErrorCode CImportError::mCode
protected

Definition at line 104 of file import_error.hpp.

Referenced by Code().

◆ mLineNumber

unsigned int CImportError::mLineNumber
protected

Definition at line 107 of file import_error.hpp.

Referenced by LineNumber(), operator=(), and SetLineNumber().

◆ mMessage

string CImportError::mMessage
protected

Definition at line 105 of file import_error.hpp.

Referenced by Message(), and operator=().

◆ mSeverity

ErrorLevel CImportError::mSeverity
protected

Definition at line 103 of file import_error.hpp.

Referenced by operator=(), Severity(), and SeverityStr().


The documentation for this class was generated from the following files:
Modified on Fri Apr 12 17:16:04 2024 by modify_doxy.py rev. 669887