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

Go to the SVN repository for this file.

1 #ifndef OBJTOOLS_BLAST_SEQDB_WRITER___WRITEDB_ERROR__HPP
2 #define OBJTOOLS_BLAST_SEQDB_WRITER___WRITEDB_ERROR__HPP
3 
4 /* $Id: writedb_error.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: Kevin Bealer
30  *
31  */
32 
33 /// @file writedb_error.hpp
34 /// Defines exception class for WriteDB.
35 ///
36 /// Defines classes:
37 /// CWriteDBException
38 ///
39 /// Implemented for: UNIX, MS-Windows
40 
41 #include <ncbiconf.h>
42 #include <corelib/ncbiobj.hpp>
43 
45 
46 /// CWriteDBException
47 ///
48 /// This exception class is thrown for WriteDB related errors such as
49 /// configuration, parameter, and file errors.
50 
52 public:
53  /// Errors are classified into one of two types.
54  enum EErrCode {
55  /// Argument validation failed.
57 
58  /// Files were missing or contents were incorrect.
59  eFileErr
60  };
61 
62  /// Get a message describing the situation leading to the throw.
63  virtual const char* GetErrCodeString() const override
64  {
65  switch ( GetErrCode() ) {
66  case eArgErr: return "eArgErr";
67  case eFileErr: return "eFileErr";
68  default: return CException::GetErrCodeString();
69  }
70  }
71 
72  /// Include standard NCBI exception behavior.
74 };
75 
77 
78 #endif // OBJTOOLS_BLAST_SEQDB_WRITER___WRITEDB_ERROR__HPP
79 
CWriteDBException.
@ eArgErr
Argument validation failed.
virtual const char * GetErrCodeString() const override
Get a message describing the situation leading to the throw.
NCBI_EXCEPTION_DEFAULT(CWriteDBException, CException)
Include standard NCBI exception behavior.
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
EErrCode
Error types that an application can generate.
Definition: ncbiexpt.hpp:884
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XOBJWRITE_EXPORT
Definition: ncbi_export.h:1347
Front end for a platform-specific configuration summary.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Sep 20 14:58:00 2024 by modify_doxy.py rev. 669887