bes Updated for version 3.20.10
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
35using std::endl;
36using std::map;
37
41BESDapErrorInfo::BESDapErrorInfo(ErrorCode ec, const string &msg) :
42 BESInfo(), _error_code(ec), _error_msg(msg)
43{
44}
45
46BESDapErrorInfo::~BESDapErrorInfo()
47{
48}
49
57void BESDapErrorInfo::begin_response(const string &response_name, BESDataHandlerInterface &dhi)
58{
59 BESInfo::begin_response(response_name, dhi);
60}
61
68void BESDapErrorInfo::add_tag(const string & /*tag_name*/, const string & /*tag_data*/, map<string, string> * /*attrs*/)
69{
70}
71
77void BESDapErrorInfo::begin_tag(const string &tag_name, map<string, string> * /*attrs*/)
78{
79 BESInfo::begin_tag(tag_name);
80}
81
88void BESDapErrorInfo::end_tag(const string &tag_name)
89{
90 BESInfo::end_tag(tag_name);
91}
92
99void BESDapErrorInfo::add_data(const string & /*s*/)
100{
101}
102
109void BESDapErrorInfo::add_space(unsigned long /*num_spaces*/)
110{
111}
112
119void BESDapErrorInfo::add_break(unsigned long /*num_breaks*/)
120{
121}
122
129void BESDapErrorInfo::add_data_from_file(const string & /*key*/, const string & /*name*/)
130{
131}
132
139void BESDapErrorInfo::add_exception(BESError & /*e*/, const string & /*admin*/)
140{
141}
142
151{
152 transmitter->send_text(*this, dhi);
153}
154
159void BESDapErrorInfo::print(ostream &strm)
160{
161 Error new_e(_error_code, _error_msg);
162 new_e.print(strm);
163}
164
172void BESDapErrorInfo::dump(ostream &strm) const
173{
174 strm << BESIndent::LMarg << "BESDapErrorInfo::dump - (" << (void *) this << ")" << endl;
175 BESIndent::Indent();
176 BESInfo::dump(strm);
177 BESIndent::UnIndent();
178}
179
virtual void begin_tag(const std::string &tag_name, std::map< std::string, std::string > *attrs=0)
begin a tagged part of the information, information to follow
virtual void add_tag(const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string > *attrs=0)
add tagged information to the informational response
virtual void print(std::ostream &strm)
ignore printing the information
virtual void add_space(unsigned long num_spaces)
add a space to the informational response
virtual void add_data(const std::string &s)
add data to the informational object
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit this informational object
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void end_tag(const std::string &tag_name)
end a tagged part of the informational response
virtual void add_exception(BESError &e, const std::string &admin)
ignore exception data to this informational object.
virtual void add_data_from_file(const std::string &key, const std::string &name)
ignore data from a file to the informational object.
virtual void add_break(unsigned long num_breaks)
add a line break to the information
Structure storing information used by the BES to handle the request.
Abstract exception class for the BES with basic string message.
Definition: BESError.h:58
informational response object
Definition: BESInfo.h:63
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESInfo.cc:124
virtual void dump(std::ostream &strm) const
Displays debug information about this object.
Definition: BESInfo.cc:275