NCBI C++ ToolKit
err_handler.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: err_handler.cpp 51883 2011-11-09 18:12:57Z ivanovp $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * File Name: $Id: err_handler.cpp 51883 2011-11-09 18:12:57Z ivanovp $
27 *
28 * Author: Michael Kholodov
29 *
30 * File Description: DataSource implementation
31 */
32 
33 #include <ncbi_pch.hpp>
34 #include "err_handler.hpp"
35 
37 
39  : m_ex( new CDB_MultiEx( DIAG_COMPILE_INFO, 0 ) )
40 {
41 }
42 
44 {
45 }
46 
48 {
49  m_ex->Push(*ex);
50  _TRACE("CToMultiExHandler::HandleIt(): exception received");
51 
52  return true;
53 }
54 
56 {
57  ITERATE(TExceptions, it, exceptions) {
58  m_ex->Push(**it);
59  }
60  return true;
61 }
62 
CDB_Exception –.
Definition: exception.hpp:118
unique_ptr< CDB_MultiEx > m_ex
Definition: err_handler.hpp:60
virtual bool HandleIt(CDB_Exception *ex)
Handle the exceptions resulting from a native API call, one-by-one.
Definition: err_handler.cpp:47
virtual ~CToMultiExHandler()
Definition: err_handler.cpp:43
virtual bool HandleAll(const TExceptions &exceptions)
Handle all of the exceptions resulting from a native API call.
Definition: err_handler.cpp:55
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
deque< CDB_Exception * > TExceptions
Exception container type.
Definition: exception.hpp:574
#define _TRACE(message)
Definition: ncbidbg.hpp:122
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Modified on Fri Sep 20 14:58:13 2024 by modify_doxy.py rev. 669887