35 using std::istringstream;
37 #include "BESShowErrorResponseHandler.h"
38 #include "BESDataNames.h"
39 #include "BESInternalError.h"
40 #include "BESInternalFatalError.h"
41 #include "BESSyntaxUserError.h"
42 #include "BESForbiddenError.h"
43 #include "BESNotFoundError.h"
44 #include "BESDataHandlerInterface.h"
46 BESShowErrorResponseHandler::BESShowErrorResponseHandler(
const string &name) :
51 BESShowErrorResponseHandler::~BESShowErrorResponseHandler()
71 string etype_s = dhi.
data[SHOW_ERROR_TYPE];
72 if (etype_s.empty()) {
73 string err = dhi.
action +
" error type missing";
76 istringstream strm(etype_s);
77 unsigned int etype = 0;
79 if (!etype || etype > 5) {
80 string err = dhi.
action +
" invalid error type, should be 1-5";
85 case BES_INTERNAL_ERROR: {
86 string err = dhi.
action +
" Internal Error";
89 case BES_INTERNAL_FATAL_ERROR: {
90 string err = dhi.
action +
" Internal Fatal Error";
93 case BES_SYNTAX_USER_ERROR: {
94 string err = dhi.
action +
" Syntax User Error";
97 case BES_FORBIDDEN_ERROR: {
98 string err = dhi.
action +
" Forbidden Error";
101 case BES_NOT_FOUND_ERROR: {
102 string err = dhi.
action +
" Not Found Error";
122 string err =
"An exception should have been thrown, nothing to transmit";
134 strm << BESIndent::LMarg <<
"BESShowErrorResponseHandler::dump - (" << (
void *)
this <<
")" << endl;
137 BESIndent::UnIndent();
141 BESShowErrorResponseHandler::ResponseBuilder(
const string &name)