diff --git a/src/binding.cc b/src/binding.cc index ef5af0f..3a008aa 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -105,7 +105,8 @@ public: String::Utf8Value conninfo(args[0]->ToString()); bool success = self->Connect(*conninfo); if(!success) { - self -> AbortConnection(); + self -> EmitLastError(); + self -> DestroyConnection(); } return Undefined(); @@ -282,13 +283,6 @@ protected: } } - //aborts connection and returns connection error message - void AbortConnection() - { - EmitLastError(); - DestroyConnection(); - } - //safely destroys the connection at most 1 time void DestroyConnection() {