mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-02 09:46:28 +00:00
Fix error message handling
This commit is contained in:
parent
b4818a21df
commit
b4bc50aacf
@ -249,7 +249,8 @@ 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 !== '') {
|
if (response.message && response.message !== '') {
|
||||||
responseError.message = response.message;
|
// Remove the type prefix from the error message (e.g. "Error: ").
|
||||||
|
responseError.message = response.message.replace(/^[a-z]+: /i, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
throw responseError;
|
throw responseError;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user