35 using std::istringstream;
40 #include "BESShowErrorResponseHandler.h"
41 #include "BESDataNames.h"
42 #include "BESInternalError.h"
43 #include "BESInternalFatalError.h"
44 #include "BESSyntaxUserError.h"
45 #include "BESForbiddenError.h"
46 #include "BESNotFoundError.h"
47 #include "BESDataHandlerInterface.h"
49 BESShowErrorResponseHandler::BESShowErrorResponseHandler(
const string &name) :
54 BESShowErrorResponseHandler::~BESShowErrorResponseHandler()
74 string etype_s = dhi.
data[SHOW_ERROR_TYPE];
75 if (etype_s.empty()) {
76 string err = dhi.
action +
" error type missing";
79 istringstream strm(etype_s);
80 unsigned int etype = 0;
82 if (!etype || etype > 5) {
83 string err = dhi.
action +
" invalid error type, should be 1-5";
88 case BES_INTERNAL_ERROR: {
89 string err = dhi.
action +
" Internal Error";
92 case BES_INTERNAL_FATAL_ERROR: {
93 string err = dhi.
action +
" Internal Fatal Error";
96 case BES_SYNTAX_USER_ERROR: {
97 string err = dhi.
action +
" Syntax User Error";
100 case BES_FORBIDDEN_ERROR: {
101 string err = dhi.
action +
" Forbidden Error";
104 case BES_NOT_FOUND_ERROR: {
105 string err = dhi.
action +
" Not Found Error";
125 string err =
"An exception should have been thrown, nothing to transmit";
137 strm << BESIndent::LMarg <<
"BESShowErrorResponseHandler::dump - (" << (
void *)
this <<
")" << endl;
140 BESIndent::UnIndent();
144 BESShowErrorResponseHandler::ResponseBuilder(
const string &name)