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.
pull/454/head
Tatsuhiro Tsujikawa 2015-08-15 17:56:05 +09:00
parent 925b5cec07
commit 17e5c98ba6
1 changed files with 4 additions and 0 deletions

View File

@ -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;