allow for connection.error to be a hash