Handle mongodb connection error