mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-22 05:05:48 +00:00
more unit tests coverage
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const common = require('../common');
|
||||
|
||||
// If a ledger is not received in this time, consider the connection offline
|
||||
@@ -28,8 +29,7 @@ function isConnected(): boolean {
|
||||
function getServerInfo(callback: (err: any, data: any) => void): void {
|
||||
this.remote.requestServerInfo((error, response) => {
|
||||
if (error) {
|
||||
const message = error && error.remote && error.remote.error_message?
|
||||
error.remote.error_message : error.message;
|
||||
const message = _.get(error, ['remote', 'error_message'], error.message);
|
||||
callback(new common.errors.RippledNetworkError(message));
|
||||
} else {
|
||||
callback(null, response.info);
|
||||
|
||||
Reference in New Issue
Block a user