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){
|
||||
parsingError = e;
|
||||
_this.emit('error', 'could not parse rpc data from method: ' + method +
|
||||
' on instance ' + instance.index + ' data: ' + data);
|
||||
if (res.statusCode === 401){
|
||||
parsingError = 'unauthorized';
|
||||
_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')
|
||||
itemFinished(dataJson.error, dataJson.result);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user