[mapserver-commits] r7619 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon May 26 09:24:41 EDT 2008


Author: dmorissette
Date: 2008-05-26 09:24:41 -0400 (Mon, 26 May 2008)
New Revision: 7619

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapogr.cpp
Log:
Avoid displaying OGR connection strings in error messages (#2629)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-05-23 17:52:58 UTC (rev 7618)
+++ trunk/mapserver/HISTORY.TXT	2008-05-26 13:24:41 UTC (rev 7619)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- Avoid displaying OGR connection strings in error messages (#2629)
+
 - WCS: respect wcs_name metadata for GetCoverage and DescribeCoverage requests
   (#2036)
 

Modified: trunk/mapserver/mapogr.cpp
===================================================================
--- trunk/mapserver/mapogr.cpp	2008-05-23 17:52:58 UTC (rev 7618)
+++ trunk/mapserver/mapogr.cpp	2008-05-26 13:24:41 UTC (rev 7619)
@@ -840,9 +840,9 @@
   if( pszDSName == NULL )
   {
       msSetError(MS_OGRERR, 
-                 "Error parsing OGR connection information:%s", 
+                 "Error parsing OGR connection information in layer `%s'", 
                  "msOGRFileOpen()",
-                 (connection?connection:"(null)") );
+                 layer->name?layer->name:"(null)" );
       return NULL;
   }
 
@@ -888,15 +888,16 @@
       {
           if( strlen(CPLGetLastErrorMsg()) == 0 )
               msSetError(MS_OGRERR, 
-                         "Open failed for OGR connection `%s'.  "
+                         "Open failed for OGR connection in layer `%s'.  "
                          "File not found or unsupported format.", 
                          "msOGRFileOpen()",
-                         pszDSSelectedName );
+                         layer->name?layer->name:"(null)" );
           else
               msSetError(MS_OGRERR, 
-                         "Open failed for OGR connection `%s'.\n%s\n",
+                         "Open failed for OGR connection in layer `%s'.\n%s\n",
                          "msOGRFileOpen()", 
-                         pszDSSelectedName, CPLGetLastErrorMsg() );
+                         layer->name?layer->name:"(null)", 
+                         CPLGetLastErrorMsg() );
           CPLFree( pszDSName );
           CPLFree( pszLayerDef );
           return NULL;
@@ -1115,7 +1116,7 @@
           msSetError(MS_OGRERR,
                      "SetAttributeFilter(%s) failed on layer %s.\n%s", 
                      "msOGRFileWhichShapes()",
-                     layer->filter.string+6, layer->name, 
+                     layer->filter.string+6, layer->name?layer->name:"(null)", 
                      CPLGetLastErrorMsg() );
           RELEASE_OGR_LOCK;
           return MS_FAILURE;
@@ -1149,9 +1150,9 @@
      (numitems = OGR_FD_GetFieldCount( hDefn )) == 0) 
   {
     msSetError(MS_OGRERR, 
-               "Layer %s,%d contains no fields.", 
+               "OGR Connection for layer `%s' contains no fields.", 
                "msOGRFileGetItems()",
-               psInfo->pszFname, psInfo->nLayerIndex );
+               layer->name?layer->name:"(null)" );
     return NULL;
   }
 
@@ -1585,11 +1586,10 @@
           msSetError(MS_OGRERR, 
                      "%s  "
                      "PROJECTION AUTO cannot be used for this "
-                     "OGR connection (`%s').",
+                     "OGR connection (in layer `%s').",
                      "msOGRLayerOpen()",
                      ms_error->message, 
-                     (pszOverrideConnection ? pszOverrideConnection:
-                                              layer->connection) );
+                     layer->name?layer->name:"(null)" );
           msOGRFileClose( layer, psInfo );
           layer->layerinfo = NULL;
           return(MS_FAILURE);



More information about the mapserver-commits mailing list