bes  Updated for version 3.20.6
dhdferr.cc
1 // This file is part of the hdf4 data handler for the OPeNDAP data server.
2 
3 // Copyright (c) 2005 OPeNDAP, Inc.
4 // Author: James Gallagher <jgallagher@opendap.org>
5 //
6 // This is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your
9 // option) any later version.
10 //
11 // This software is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this software; if not, write to the Free Software Foundation,
18 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
21 
23 // Copyright 1996, by the California Institute of Technology.
24 // ALL RIGHTS RESERVED. United States Government Sponsorship
25 // acknowledged. Any commercial use must be negotiated with the
26 // Office of Technology Transfer at the California Institute of
27 // Technology. This software may be subject to U.S. export control
28 // laws and regulations. By accepting this software, the user
29 // agrees to comply with all applicable U.S. export laws and
30 // regulations. User has the responsibility to obtain export
31 // licenses, or other export authority as may be required before
32 // exporting such information to foreign countries or providing
33 // access to foreign persons.
34 
35 // Author: Todd Karakashian, NASA/Jet Propulsion Laboratory
36 // Todd.K.Karakashian@jpl.nasa.gov
37 //
39 
40 #include <sstream>
41 
42 using std::ostringstream;
43 using std::endl;
44 
45 #include "config_hdf.h"
46 
47 #include <mfhdf.h>
48 #include <BESLog.h>
49 #include "hcerr.h"
50 #include "dhdferr.h"
51 
52 dhdferr::dhdferr(const string & msg, const string & file, int line)
53  :Error(msg)
54 {
55  ostringstream strm;
56  strm << get_error_message() << endl
57  << "Location: \"" << file << "\", line " << line;
58  (*BESLog::TheLog()) << strm.str() << endl ;
59 }
60 
61 dhdferr_hcerr::dhdferr_hcerr(const string & msg, const string & file, int line)
62  :dhdferr(msg, file, line)
63 {
64  ostringstream strm;
65  strm << get_error_message() << endl
66  << "Location: \"" << file << "\", line " << line;
67  for (int i = 0; i < 5; ++i)
68  strm << i << ") " << HEstring((hdf_err_code_t) HEvalue(i)) << endl;
69  (*BESLog::TheLog()) << strm.str() << endl ;
70 }
71 
dhdferr
Definition: dhdferr.h:54
Error