Properly handle connection errors

Handled errors occurred in Connection and forced the object to emit the 'error' message such that the caller can handle when an error occurs.

The test scenario uses the error caused by passive queue declaration.