Catch error better for invalid rpc auth
This commit is contained in:
parent
4a088b19fc
commit
a608380597
@ -92,9 +92,15 @@ function DaemonInterface(options){
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
parsingError = e;
|
if (res.statusCode === 401){
|
||||||
_this.emit('error', 'could not parse rpc data from method: ' + method +
|
parsingError = 'unauthorized';
|
||||||
' on instance ' + instance.index + ' data: ' + data);
|
_this.emit('error', 'Invalid RPC username or password');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
parsingError = e;
|
||||||
|
_this.emit('error', 'could not parse rpc data from method: ' + method +
|
||||||
|
' on instance ' + instance.index + ' data: ' + data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (typeof(dataJson) !== 'undefined')
|
if (typeof(dataJson) !== 'undefined')
|
||||||
itemFinished(dataJson.error, dataJson.result);
|
itemFinished(dataJson.error, dataJson.result);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user