fix: 🐛 Improve logging and output and error-handling
parent
3a76f49a79
commit
bf7f011657
14
main.js
14
main.js
|
@ -37,12 +37,14 @@ module.exports = class Wallet {
|
|||
method: method,
|
||||
params: params,
|
||||
})
|
||||
if (res.status!==200) throw res.data
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
console.log(res.data)
|
||||
return res.data
|
||||
if (res.status!==200)
|
||||
throw new Error(res.statusText)
|
||||
if (res.data.error)
|
||||
throw new Error(res.data.error.message)
|
||||
if (!res.data.result)
|
||||
throw new Error('No result sent')
|
||||
} catch (err) { console.error(err) }
|
||||
return res.data.result
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "monero-wallet-rpc-js",
|
||||
"type": "commonjs",
|
||||
"version": "1.1.14",
|
||||
"version": "1.1.15",
|
||||
"description": "Javascript wrapper for monero-wallet-rpc calls",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue