Skip to content

Commit c026942

Browse files
authored
Merge pull request #13 from jgriffiths/misc
Two minor fixes
2 parents ae35af4 + a8eadb1 commit c026942

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/jsonrpccxx/client.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ namespace jsonrpccxx {
5959
json response = json::parse(connector.Send(j.dump()));
6060
if (has_key_type(response, "error", json::value_t::object)) {
6161
throw JsonRpcException::fromJson(response["error"]);
62+
} else if (has_key_type(response, "error", json::value_t::string)) {
63+
throw JsonRpcException(-32603, response["error"]);
6264
}
6365
if (has_key(response, "result") && has_key(response, "id")) {
6466
if (response["id"].type() == json::value_t::string)

include/jsonrpccxx/common.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#include "common.hpp"
32
#include "nlohmann/json.hpp"
43
#include <exception>
54
#include <string>
@@ -46,4 +45,4 @@ namespace jsonrpccxx {
4645
json data;
4746
std::string err;
4847
};
49-
} // namespace jsonrpccxx
48+
} // namespace jsonrpccxx

0 commit comments

Comments
 (0)