dbd/postgresql/connection.c

changeset 4
c50b0e6f25d6
parent 3
b61020ca4753
child 13
10c8c6f0da14
--- a/dbd/postgresql/connection.c	Wed Nov 26 10:01:03 2008 +0000
+++ b/dbd/postgresql/connection.c	Wed Nov 26 10:43:45 2008 +0000
@@ -31,7 +31,7 @@
 		snprintf(portbuf, sizeof(portbuf), "%d", pport);
 		port = portbuf;
 	    } else {
-		luaL_error(L, "Invalid port %d", pport);
+		luaL_error(L, DBI_ERR_INVALID_PORT, pport);
 	    }
 	}
     case 4: 
@@ -55,7 +55,7 @@
 
     if (PQstatus(conn->postgresql) != CONNECTION_OK) {
 	lua_pushnil(L);
-	lua_pushfstring(L, "Failed to connect to database: %s", PQerrorMessage(conn->postgresql));
+	lua_pushfstring(L, DBI_ERR_CONNECTION_FAILED, PQerrorMessage(conn->postgresql));
 	return 2;
     }
 
@@ -111,7 +111,7 @@
     }
 
     lua_pushnil(L);    
-    lua_pushstring(L, "Database not available");
+    lua_pushstring(L, DBI_ERR_DB_UNAVAILABLE);
     return 2;
 }
 

mercurial