1 #ifndef SRA__READER__SRA__EXCEPTION__HPP
2 #define SRA__READER__SRA__EXCEPTION__HPP
51 #ifndef NCBI_EXCEPTION3_VAR
53 # define NCBI_EXCEPTION3_VAR(name, exc_cls, err_code, msg, extra1, extra2) \
54 exc_cls name(DIAG_COMPILE_INFO, 0, exc_cls::err_code, msg, \
58 #ifndef NCBI_EXCEPTION3
59 # define NCBI_EXCEPTION3(exc_cls, err_code, msg, extra1, extra2) \
60 NCBI_EXCEPTION3_VAR(NCBI_EXCEPTION_EMPTY_NAME, \
61 exc_cls, err_code, msg, extra1, extra2)
65 # define NCBI_THROW3(exc_cls, err_code, msg, extra1, extra2) \
66 throw NCBI_EXCEPTION3(exc_cls, err_code, msg, extra1, extra2)
70 # define NCBI_RETHROW3(prev_exc, exc_cls, err_code, msg, extra1, extra2) \
71 throw exc_cls(DIAG_COMPILE_INFO, &(prev_exc), exc_cls::err_code, msg, \
106 const string& message,
111 const string& message,
117 const string& message,
124 const string& message,
135 virtual const char*
GetType(
void)
const;
158 static bool IsTimeout(
rc_t rc);
160 static void ReportError(
const char* msg,
rc_t rc);
175 #ifndef NCBI_THROW2_FMT
176 # define NCBI_THROW2_FMT(exception_class, err_code, message, extra) \
177 throw NCBI_EXCEPTION2(exception_class, err_code, FORMAT(message), extra)
181 #define CHECK_VDB_TIMEOUT(msg, rc) \
183 if ( rc && CSraException::IsTimeout(rc) ) \
184 NCBI_THROW2(CSraException, eTimeout, msg, rc); \
186 #define CHECK_VDB_TIMEOUT_FMT(msg, rc) \
188 if ( rc && CSraException::IsTimeout(rc) ) \
189 NCBI_THROW2_FMT(CSraException, eTimeout, msg, rc); \
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.
EErrCode
Error types that corelib can generate.
@ eNotFoundValue
DB value not found.
@ eProtectedDb
DB is protected.
@ eDataError
VDB data is incorrect.
@ eAddRefFailed
AddRef failed.
@ eNotFoundColumn
DB column not found.
@ eInvalidArg
Invalid argument error.
@ eNullPtr
Null pointer error.
@ eNotFoundDb
DB main file not found.
@ eTimeout
timeout, re-try logic is recommended
@ eNotFound
Data not found.
@ eInitFailed
Initialization failed.
@ eNotFoundTable
DB table not found.
@ eNotFoundIndex
VDB index not found.
@ eInvalidState
State of object is invalid for the operation.
@ eInvalidIndex
Invalid index for array-like retrieval.
void SetParam(const string ¶m)
int TErrCode
Translate from the error code value to its string representation.
const string & GetParam(void) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
virtual void ReportExtra(ostream &out) const
Report "non-standard" attributes.
virtual const char * GetType(void) const
Get class name as a string.
TErrCode GetErrCode(void) const
Get error code.
virtual const CException * x_Clone(void) const
Helper method for cloning the exception.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
#define NCBI_SRAREAD_EXPORT
Defines NCBI C++ exception handling.