mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-22 12:30:58 +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') {
|
||||
let responseError = deserialize_json_value(error);
|
||||
if (response.message && response.message !== '') {
|
||||
responseError.message = response.message;
|
||||
}
|
||||
|
||||
throw responseError;
|
||||
}
|
||||
|
||||
|
@ -371,8 +371,7 @@ json RPCServer::perform_request(std::string name, const json &args) {
|
||||
catch (...) {
|
||||
exceptionAsJson = {{"error", "An exception occured while processing the request. Could not serialize the exception as JSON"}};
|
||||
}
|
||||
|
||||
return (json){{"error", exceptionAsJson}};
|
||||
return (json){{"error", exceptionAsJson}, {"message", ex.what()}};
|
||||
}
|
||||
catch (std::exception &exception) {
|
||||
return (json){{"error", exception.what()}};
|
||||
|
Loading…
x
Reference in New Issue
Block a user