OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
dhdferr.h
Go to the documentation of this file.
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 #ifndef _DHDFERR_H
41 #define _DHDFERR_H
42 
43 #include <iostream>
44 #include <string>
45 #include <hcerr.h>
46 
47 #include "Error.h"
48 
49 using namespace libdap;
50 
51 #define THROW(x) throw x(__FILE__,__LINE__)
52 
53 // DODS/HDF exceptions class
54 class dhdferr:public Error {
55  public:
56  dhdferr(const string & msg, const string & file, int line);
57  virtual ~ dhdferr(void) {
58 }};
59 
60 // Define valid DODS/HDF exceptions
61 class dhdferr_hcerr:public dhdferr {
62  public:
63  dhdferr_hcerr(const string & msg, const string & file, int line);
64 }; // An hdfclass error occured
65 
66 class dhdferr_addattr:public dhdferr {
67  public:
68  dhdferr_addattr(const string & file,
69  int
70  line):dhdferr(string
71  ("Error occurred while trying to add attribute to DAS"),
72  file, line) {
73 }}; // AttrTable::append_attr() failed
74 
75 class dhdferr_ddssem:public dhdferr {
76  public:
77  dhdferr_ddssem(const string & file,
78  int line):dhdferr(string("Problem with DDS semantics"),
79  file, line) {
80 }}; // DDS::check_semantics() returned false
81 
82 class dhdferr_dassem:public dhdferr {
83  public:
84  dhdferr_dassem(const string & file,
85  int line):dhdferr(string("Problem with DAS semantics"),
86  file, line) {
87 }}; // DAS::check_semantics() returned false
88 
89 class dhdferr_ddsout:public dhdferr {
90  public:
91  dhdferr_ddsout(const string & file,
92  int line):dhdferr(string("Could not write to DDS file"),
93  file, line) {
94 }}; // error writing to DDS file
95 
96 class dhdferr_dasout:public dhdferr {
97  public:
98  dhdferr_dasout(const string & file,
99  int line):dhdferr(string("Could not write to DAS file"),
100  file, line) {
101 }}; // error writing to DAS file
102 
103 class dhdferr_arrcons:public dhdferr {
104  public:
105  dhdferr_arrcons(const string & file,
106  int
107  line):dhdferr(string
108  ("Error occurred while reading Array constraint"),
109  file, line) {
110 }}; // constraints read for Array slab did not make sense
111 
112 class dhdferr_datatype:public dhdferr {
113  public:
114  dhdferr_datatype(const string & file,
115  int
116  line):dhdferr(string
117  ("Data type is not supported by DODS"),
118  file, line) {
119 }}; // data type is not supported by DODS
120 
121 class dhdferr_consist:public dhdferr {
122  public:
123  dhdferr_consist(const string & file,
124  int
125  line):dhdferr(string("Internal consistency problem"),
126  file, line) {
127 }}; // something that is not supposed to happen did
128 
129 class dhdferr_hcread:public dhdferr {
130  public:
131  dhdferr_hcread(const string & file,
132  int line):dhdferr(string("Problem reading HDF data"),
133  file, line) {
134 }}; // something went wrong when reading using the HDFCLASS library
135 
136 class dhdferr_conv:public dhdferr {
137  public:
138  dhdferr_conv(const string & file,
139  int
140  line):dhdferr(string
141  ("Problem converting HDF data to DODS"),
142  file, line) {
143 }}; // something went wrong in a conversion to DAP
144 
145 class dhdferr_fexist:public dhdferr {
146  public:
147  dhdferr_fexist(const string & file,
148  int
149  line):dhdferr(string
150  ("HDF file does not exist or is unreadable"),
151  file, line) {
152 }}; // could not stat the input HDF file
153 
154 #endif // _DHDFERR_H
dhdferr_addattr(const string &file, int line)
Definition: dhdferr.h:68
dhdferr_dassem(const string &file, int line)
Definition: dhdferr.h:84
dhdferr_consist(const string &file, int line)
Definition: dhdferr.h:123
static class NCMLUtil overview
dhdferr_datatype(const string &file, int line)
Definition: dhdferr.h:114
dhdferr_arrcons(const string &file, int line)
Definition: dhdferr.h:105
dhdferr_hcread(const string &file, int line)
Definition: dhdferr.h:131
dhdferr_fexist(const string &file, int line)
Definition: dhdferr.h:147
dhdferr_ddssem(const string &file, int line)
Definition: dhdferr.h:77
dhdferr_ddsout(const string &file, int line)
Definition: dhdferr.h:91
dhdferr_conv(const string &file, int line)
Definition: dhdferr.h:138
dhdferr_dasout(const string &file, int line)
Definition: dhdferr.h:98