]> granicus.if.org Git - apache/commitdiff
Try to get a meaningful error message when dbd_open fails
authorNick Kew <niq@apache.org>
Tue, 26 Aug 2008 21:03:46 +0000 (21:03 +0000)
committerNick Kew <niq@apache.org>
Tue, 26 Aug 2008 21:03:46 +0000 (21:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@689224 13f79535-47bb-0310-9956-ffa450edef68

modules/database/mod_dbd.c

index f1adfd41a28d7e20d570e485b788b9bdc94f2a42..dbf876faeae48494157429bdbf4dad1fb3470446 100644 (file)
@@ -464,6 +464,7 @@ static apr_status_t dbd_construct(void **data_ptr,
     apr_pool_t *rec_pool, *prepared_pool;
     ap_dbd_t *rec;
     apr_status_t rv;
+    const char *err = "";
 
     rv = apr_pool_create(&rec_pool, pool);
     if (rv != APR_SUCCESS) {
@@ -507,12 +508,12 @@ static apr_status_t dbd_construct(void **data_ptr,
         return rv;
     }
 
-    rv = apr_dbd_open(rec->driver, rec->pool, cfg->params, &rec->handle);
+    rv = apr_dbd_open_ex(rec->driver, rec->pool, cfg->params, &rec->handle, &err);
     if (rv != APR_SUCCESS) {
         switch (rv) {
         case APR_EGENERAL:
             ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server,
-                         "DBD: Can't connect to %s", cfg->name);
+                         "DBD: Can't connect to %s: %s", cfg->name, &err);
             break;
         default:
             ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server,