NCBI C++ ToolKit
alnexception.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJECTS_ALNMGR___ALNEXCEPTION__HPP
2 #define OBJECTS_ALNMGR___ALNEXCEPTION__HPP
3 
4 /* $Id: alnexception.hpp 84663 2018-11-27 18:22:00Z ucko $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Mike DiCuccio, NCBI
30  *
31  * File Description:
32  * Exception for various alignment manager related issues
33  *
34  */
35 
36 #include <corelib/ncbiexpt.hpp>
37 
39 BEGIN_objects_SCOPE
40 
41 
43 {
44 public:
45  enum EErrCode {
58  };
59 
60  virtual const char *GetErrCodeString(void) const override
61  {
62  switch (GetErrCode()) {
63  case eInvalidRequest: return "eInvalidRequest";
64  case eConsensusNotPresent: return "eConsensusNotPresent";
65  case eInvalidSeqId: return "eInvalidSeqId";
66  case eInvalidRow: return "eInvalidRow";
67  case eInvalidSegment: return "eInvalidSegment";
68  case eInvalidAlignment: return "eInvalidAlignment";
69  case eInvalidDenseg: return "eInvalidDenseg";
70  case eTranslateFailure: return "eTranslateFailure";
71  case eMergeFailure: return "eMergeFailure";
72  case eUnknownMergeFailure: return "eUnknownMergeFailure";
73  case eInternalFailure: return "eInternalFailure";
74  case eUnsupported: return "eUnsupported";
75  default: return CException::GetErrCodeString();
76  }
77  }
78 
80 };
81 
82 
83 #define _ALNMGR_ASSERT(expr) \
84  do { \
85  if ( !(expr) ) { \
86  _ASSERT(expr); \
87  NCBI_THROW(CAlnException, eInternalFailure, \
88  string("Assertion failed: ") + #expr); \
89  } \
90  } while ( 0 )
91 
92 
93 END_objects_SCOPE
95 
96 #endif /* OBJECTS_ALNMGR___ALNEXCEPTION__HPP */
NCBI_EXCEPTION_DEFAULT(CAlnException, CException)
virtual const char * GetErrCodeString(void) const override
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
Definition: ncbiexpt.hpp:1388
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Defines NCBI C++ exception handling.
Modified on Fri Sep 20 14:57:58 2024 by modify_doxy.py rev. 669887