json-rpc error handling (#128)
* json-rpc error handling * partial revert
This commit is contained in:
parent
c3535e6ed3
commit
82726fd9c1
2 changed files with 39 additions and 16 deletions
18
dev/json-rpc.js
Normal file
18
dev/json-rpc.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue