Преглед на файлове

Merge pull request #5931 from afishbeck/jsonExceptionFormatting

HPCC-11173 Fix roxie JSON Exception formatting

Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman преди 11 години
родител
ревизия
e104922cb2
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      roxie/ccd/ccdlistener.cpp

+ 5 - 5
roxie/ccd/ccdlistener.cpp

@@ -96,7 +96,7 @@ static void sendJsonException(SafeSocket &client, IException *E, const char *que
         if (!queryName)
             queryName = "Unknown"; // Exceptions when parsing query XML can leave queryName unset/unknowable....
 
-        StringBuffer response("{");
+        StringBuffer response;
         appendfJSONName(response, "%sResponse", queryName).append(" {");
         appendJSONName(response, "Results").append(" {");
         appendJSONName(response, "Exception").append(" [{");
@@ -104,7 +104,7 @@ static void sendJsonException(SafeSocket &client, IException *E, const char *que
         appendJSONValue(response, "Code", E->errorCode());
         StringBuffer s;
         appendJSONValue(response, "Message", E->errorMessage(s).str());
-        response.append("}]}}}");
+        response.append("}]}}");
         client.write(response.str(), response.length());
     }
     catch(IException *EE)
@@ -1794,7 +1794,7 @@ readAnother:
             if (client)
             {
                 if (isHTTP)
-                    sendSoapException(*client, E, queryName);
+                    sendHttpException(*client, httpHelper.queryContentFormat(), E, queryName);
                 else
                     client->sendException("Roxie", code, error.str(), isBlocked, logctx);
             }
@@ -1819,7 +1819,7 @@ readAnother:
             if (client)
             {
                 if (isHTTP)
-                    sendHttpException(*client, mlFmt, E, queryName);
+                    sendHttpException(*client, httpHelper.queryContentFormat(), E, queryName);
                 else
                     client->sendException("Roxie", code, error.str(), isBlocked, logctx);
             }
@@ -1839,7 +1839,7 @@ readAnother:
                 if (isHTTP)
                 {
                     Owned<IException> E = MakeStringException(ROXIE_INTERNAL_ERROR, "Unknown exception");
-                    sendSoapException(*client, E, queryName);
+                    sendHttpException(*client, httpHelper.queryContentFormat(), E, queryName);
                 }
                 else
                     client->sendException("Roxie", ROXIE_INTERNAL_ERROR, "Unknown exception", isBlocked, logctx);