Merge pull request #387 from brianc/issues/350
Ensure error being returned to native client
This commit is contained in:
commit
9d773a29c2
@ -87,8 +87,7 @@ public:
|
||||
TRACE("Received IO event");
|
||||
|
||||
if(status == -1) {
|
||||
LOG("Connection error.");
|
||||
return;
|
||||
TRACE("Connection error. -1 status from lib_uv_poll");
|
||||
}
|
||||
|
||||
Connection *connection = static_cast<Connection*>(w->data);
|
||||
|
@ -114,18 +114,22 @@ test('non-error calls supplied callback', function() {
|
||||
});
|
||||
|
||||
test('when connecting to invalid host', function() {
|
||||
return false;
|
||||
var client = new Client({
|
||||
user: 'aslkdjfsdf',
|
||||
password: '1234',
|
||||
host: 'asldkfjasdf!!#1308140.com'
|
||||
});
|
||||
assert.emits(client, 'error');
|
||||
var delay = 5000;
|
||||
var tid = setTimeout(function() {
|
||||
assert(false, "When connecting to an invalid host the error event should be emitted but it has been " + delay + " and still no error event.");
|
||||
}, delay);
|
||||
client.on('error', function() {
|
||||
clearTimeout(tid);
|
||||
})
|
||||
client.connect();
|
||||
});
|
||||
|
||||
test('when connecting to invalid host with callback', function() {
|
||||
return false;
|
||||
var client = new Client({
|
||||
user: 'brian',
|
||||
password: '1234',
|
||||
|
Loading…
Reference in New Issue
Block a user