pass back the raw connection in the error callback

So that end users can handle the connection how they want when
bad things happen