lamassu-server/dev/json-rpc.js
Fabio Cigliano 82726fd9c1 json-rpc error handling (#128)
* json-rpc error handling

* partial revert
2018-06-16 13:55:58 +03:00

18 lines
390 B
JavaScript

const rpc = require('../lib/plugins/common/json-rpc')
const account = {
username: 'test',
password: 'test'
}
const method = {}
const params = {
url: 'https://httpstat.us/500'
// url: 'https://httpstat.us/400'
// url: 'https://httpstat.us/200'
}
rpc.fetch(account, method, params)
.then(res => console.log('got result', res))
.catch(err => console.error('gor error', err))