Sfoglia il codice sorgente

Return 200 HTTP status code if exception was caught while executing RPC method

Previously, we returned 500 HTTP status code.  I think the found in
RPC level, not in HTTP protocol, so 500 is not appropriate.
Tatsuhiro Tsujikawa 10 anni fa
parent
commit
17e5c98ba6
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      src/HttpServerBodyCommand.cc

+ 4 - 0
src/HttpServerBodyCommand.cc

@@ -115,6 +115,10 @@ void HttpServerBodyCommand::sendJsonRpcResponse
     httpServer_->disableKeepAlive();
     int httpCode;
     switch(res.code) {
+    case 1:
+      // error caught while executing RpcMethod
+      httpCode = 200;
+      break;
     case -32600:
       httpCode = 400;
       break;