mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-22 20:41:18 +00:00
Fix RPC server to include exception message
This commit is contained in:
parent
aaabc1e286
commit
b8fc18e7e9
@ -248,6 +248,10 @@ function sendRequest(command, data, host = sessionHost) {
|
|||||||
}
|
}
|
||||||
else if (error.type && error.type == 'dict') {
|
else if (error.type && error.type == 'dict') {
|
||||||
let responseError = deserialize_json_value(error);
|
let responseError = deserialize_json_value(error);
|
||||||
|
if (response.message && response.message !== '') {
|
||||||
|
responseError.message = response.message;
|
||||||
|
}
|
||||||
|
|
||||||
throw responseError;
|
throw responseError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,8 +371,7 @@ json RPCServer::perform_request(std::string name, const json &args) {
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
exceptionAsJson = {{"error", "An exception occured while processing the request. Could not serialize the exception as JSON"}};
|
exceptionAsJson = {{"error", "An exception occured while processing the request. Could not serialize the exception as JSON"}};
|
||||||
}
|
}
|
||||||
|
return (json){{"error", exceptionAsJson}, {"message", ex.what()}};
|
||||||
return (json){{"error", exceptionAsJson}};
|
|
||||||
}
|
}
|
||||||
catch (std::exception &exception) {
|
catch (std::exception &exception) {
|
||||||
return (json){{"error", exception.what()}};
|
return (json){{"error", exception.what()}};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user