Просмотр исходного кода

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 лет назад
Родитель
Сommit
17e5c98ba6
1 измененных файлов с 4 добавлено и 0 удалено
  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;