Skip to content

Commit

Permalink
asynctest: print first startup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
markokr committed Mar 5, 2008
1 parent 5eb41f7 commit 5482e20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/asynctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ static void disconnect(DbConn *db, bool is_err, const char *reason, ...)
/* some error happened */
static void conn_error(DbConn *db, const char *desc)
{
static int ecount = 0;
if (db->con) {
/* fixme show firt couple errors */
if (ecount++ < 3)
printf("\r%s\n", PQerrorMessage(db->con));
disconnect(db, true, "%s: %s", desc, PQerrorMessage(db->con));
} else {
printf("random error: %s\n", desc);
Expand Down

0 comments on commit 5482e20

Please sign in to comment.