added JsonInternalErrorException

This commit is contained in:
badaix 2015-09-01 22:52:37 +02:00
parent 707f198a26
commit e05e2fdd9d
2 changed files with 18 additions and 51 deletions

View file

@ -130,54 +130,3 @@ Json JsonNotification::getJson(const std::string& method, Json data)
return notification;
}
/*
if ((method == "get") || (method == "set"))
{
vector<string> params;
try
{
params = request["params"].get<vector<string>>();
}
catch (const exception& e)
{
throw JsonRpcException(e.what(), -32602);
}
if (method == "get")
{
//{"jsonrpc": "2.0", "method": "get", "params": ["status"], "id": 2}
//{"jsonrpc": "2.0", "method": "get", "params": ["status", "server"], "id": 2}
//{"jsonrpc": "2.0", "method": "get", "params": ["status", "client"], "id": 2}
//{"jsonrpc": "2.0", "method": "get", "params": ["status", "client", "MAC"], "id": 2}
vector<string> params = request["params"].get<vector<string>>();
for (auto s: params)
logO << s << "\n";
response["result"] = "???";//nullptr;
}
else if (method == "set")
{
//{"jsonrpc": "2.0", "method": "set", "params": ["volume", "0.9", "client", "MAC"], "id": 2}
//{"jsonrpc": "2.0", "method": "set", "params": ["active", "client", "MAC"], "id": 2}
response["result"] = "234";//nullptr;
}
}
else
throw JsonRpcException("method not found: \"" + method + "\"", -32601);
connection->send(response.dump());
*/
/*
Json response = {
{"jsonrpc", "2.0"},
{"id", id}
};
*/