improved error message when there is issue communicating with node

This commit is contained in:
Evgeniy Filatov 2018-10-02 02:01:08 +03:00 committed by Pascal Precht
parent 34cafc77e8
commit 517365353b
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,11 @@ class CodeRunner {
const value = await result;
cb(null, value);
} catch (error) {
// Improve error message when there's no connection to node
if (error.message.indexOf('Invalid JSON RPC response') !== -1) {
error.message += '. Are you connected to an Ethereum node?';
}
cb(error);
}
}