diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index 7851b0a..feb4196 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -656,7 +656,7 @@ _conn_poll_connecting(connectionObject *self) break; case PGRES_POLLING_FAILED: case PGRES_POLLING_ACTIVE: - PyErr_SetString(OperationalError, "asynchronous connection failed"); + PyErr_SetString(OperationalError, PQerrorMessage(self->pgconn)); res = PSYCO_POLL_ERROR; break; }