[Greater-commits] r377 - trunk/GREAT-ER-DB/impl/postgresql

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 8 11:39:02 CEST 2011


Author: bricks
Date: 2011-07-08 11:39:00 +0200 (Fri, 08 Jul 2011)
New Revision: 377

Modified:
   trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Be more verbose if an file error occured while inserting und updating bin objects
Also print the file that is actually failed to open in the error message

Fix indentation


Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-07-07 15:49:51 UTC (rev 376)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-07-08 09:39:00 UTC (rev 377)
@@ -55,6 +55,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <errno.h>
 
 /* PostgreSQL includes */
  EXEC SQL INCLUDE sqlca; 
@@ -10486,8 +10487,8 @@
     
     \return DA_SUCCESS \n DA_FAIL
 */
-int gda_load_bin_obj (DB_con 	      *db_con, 
-		      DA_T_bin_obj    *vp_bin_obj,
+int gda_load_bin_obj (DB_con          *db_con, 
+                      DA_T_bin_obj    *vp_bin_obj,
                       char             vp_get_file_obj,
                       char            *vp_filepath,
                       char            *vp_filename,
@@ -10545,7 +10546,7 @@
           /* ERROR opening the input file */
           vp_errinfo->err_type = DA_ERRTYP_INT;
           vp_errinfo->err_no   = DA_ERR_MEMORY_ALLOC;
-          sprintf(vp_errinfo->err_param, "%s%s", "gda_load_bin_obj_tab() - fileopen(ERROR): ",vp_filename);
+          sprintf(vp_errinfo->err_param, "%s%d:%s %s", "gda_load_bin_obj_tab() - fileopen(ERROR): ", errno, strerror(errno), v_inputfile);
           return(DA_FAIL);
         }            
  
@@ -10752,8 +10753,8 @@
     
     \return DA_SUCCESS \n DA_FAIL
 */
-int gda_load_bin_obj_update (DB_con 	     *db_con, 
-			     DA_T_bin_obj    *vp_bin_obj,
+int gda_load_bin_obj_update (DB_con          *db_con, 
+                             DA_T_bin_obj    *vp_bin_obj,
                              char             vp_get_file_obj,
                              char            *vp_filepath,
                              char            *vp_filename,
@@ -10815,7 +10816,7 @@
               /* ERROR opening the input file */
               vp_errinfo->err_type = DA_ERRTYP_INT;
               vp_errinfo->err_no   = DA_ERR_MEMORY_ALLOC;
-              sprintf(vp_errinfo->err_param, "%s%s", "gda_load_bin_obj_tab() - fileopen(ERROR): ",vp_filename);
+              sprintf(vp_errinfo->err_param, "%s%d:%s %s", "gda_load_bin_obj_tab() - fileopen(ERROR): ", errno, strerror(errno), v_inputfile);
 
               return(DA_FAIL);
             }   



More information about the Greater-commits mailing list