bes  Updated for version 3.20.5
BESDapErrorInfo.cc
1 // BESDapErrorInfo.cc
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #include "BESDapErrorInfo.h"
34 
38 BESDapErrorInfo::BESDapErrorInfo(ErrorCode ec, const string &msg) :
39  BESInfo(), _error_code(ec), _error_msg(msg)
40 {
41 }
42 
43 BESDapErrorInfo::~BESDapErrorInfo()
44 {
45 }
46 
54 void BESDapErrorInfo::begin_response(const string &response_name, BESDataHandlerInterface &dhi)
55 {
56  BESInfo::begin_response(response_name, dhi);
57 }
58 
65 void BESDapErrorInfo::add_tag(const string & /*tag_name*/, const string & /*tag_data*/, map<string, string> * /*attrs*/)
66 {
67 }
68 
74 void BESDapErrorInfo::begin_tag(const string &tag_name, map<string, string> * /*attrs*/)
75 {
76  BESInfo::begin_tag(tag_name);
77 }
78 
85 void BESDapErrorInfo::end_tag(const string &tag_name)
86 {
87  BESInfo::end_tag(tag_name);
88 }
89 
96 void BESDapErrorInfo::add_data(const string & /*s*/)
97 {
98 }
99 
106 void BESDapErrorInfo::add_space(unsigned long /*num_spaces*/)
107 {
108 }
109 
116 void BESDapErrorInfo::add_break(unsigned long /*num_breaks*/)
117 {
118 }
119 
126 void BESDapErrorInfo::add_data_from_file(const string & /*key*/, const string & /*name*/)
127 {
128 }
129 
136 void BESDapErrorInfo::add_exception(BESError & /*e*/, const string & /*admin*/)
137 {
138 }
139 
148 {
149  transmitter->send_text(*this, dhi);
150 }
151 
156 void BESDapErrorInfo::print(ostream &strm)
157 {
158  Error new_e(_error_code, _error_msg);
159  new_e.print(strm);
160 }
161 
169 void BESDapErrorInfo::dump(ostream &strm) const
170 {
171  strm << BESIndent::LMarg << "BESDapErrorInfo::dump - (" << (void *) this << ")" << endl;
172  BESIndent::Indent();
173  BESInfo::dump(strm);
174  BESIndent::UnIndent();
175 }
176 
BESDapErrorInfo::print
virtual void print(ostream &strm)
ignore printing the information
Definition: BESDapErrorInfo.cc:156
BESDapErrorInfo::add_break
virtual void add_break(unsigned long num_breaks)
add a line break to the information
Definition: BESDapErrorInfo.cc:116
BESInfo::begin_response
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESInfo.cc:124
BESDapErrorInfo::add_space
virtual void add_space(unsigned long num_spaces)
add a space to the informational response
Definition: BESDapErrorInfo.cc:106
BESDapErrorInfo::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition: BESDapErrorInfo.cc:169
BESDapErrorInfo::add_data
virtual void add_data(const string &s)
add data to the informational object
Definition: BESDapErrorInfo.cc:96
BESInfo
informational response object
Definition: BESInfo.h:68
BESDapErrorInfo::begin_tag
virtual void begin_tag(const string &tag_name, map< string, string > *attrs=0)
begin a tagged part of the information, information to follow
Definition: BESDapErrorInfo.cc:74
BESInfo::dump
virtual void dump(ostream &strm) const
Displays debug information about this object.
Definition: BESInfo.cc:275
BESDapErrorInfo::add_exception
virtual void add_exception(BESError &e, const string &admin)
ignore exception data to this informational object.
Definition: BESDapErrorInfo.cc:136
BESDapErrorInfo::end_tag
virtual void end_tag(const string &tag_name)
end a tagged part of the informational response
Definition: BESDapErrorInfo.cc:85
BESDapErrorInfo::add_data_from_file
virtual void add_data_from_file(const string &key, const string &name)
ignore data from a file to the informational object.
Definition: BESDapErrorInfo.cc:126
BESTransmitter
Definition: BESTransmitter.h:47
BESDapErrorInfo::transmit
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit this informational object
Definition: BESDapErrorInfo.cc:147
BESDapErrorInfo::begin_response
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESDapErrorInfo.cc:54
Error
BESDapErrorInfo::add_tag
virtual void add_tag(const string &tag_name, const string &tag_data, map< string, string > *attrs=0)
add tagged information to the informational response
Definition: BESDapErrorInfo.cc:65
BESDataHandlerInterface
Structure storing information used by the BES to handle the request.
Definition: BESDataHandlerInterface.h:60
BESError
Abstract exception class for the BES with basic string message.
Definition: BESError.h:58