@@ -191,7 +191,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
191
191
// checking if table GEOMETRY_COLUMNS exists and has the expected layout
192
192
ret = sqlite3_get_table ( handle, " PRAGMA table_info(geometry_columns)" , &results, &rows, &columns, &errMsg );
193
193
if ( ret != SQLITE_OK )
194
+ {
195
+ mErrorMsg = tr ( " table info on %1 failed" ).arg ( " geometry_columns" );
194
196
goto error;
197
+ }
195
198
if ( rows < 1 )
196
199
;
197
200
else
@@ -224,7 +227,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
224
227
// checking if table SPATIAL_REF_SYS exists and has the expected layout
225
228
ret = sqlite3_get_table ( handle, " PRAGMA table_info(spatial_ref_sys)" , &results, &rows, &columns, &errMsg );
226
229
if ( ret != SQLITE_OK )
230
+ {
231
+ mErrorMsg = tr ( " table info on %1 failed" ).arg ( " spatial_ref_sys" );
227
232
goto error;
233
+ }
228
234
if ( rows < 1 )
229
235
;
230
236
else
@@ -263,10 +269,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
263
269
264
270
error:
265
271
// unexpected IO error
266
- mErrorMsg = tr ( " unknown error cause" );
267
- if ( errMsg != NULL )
272
+ if ( errMsg )
268
273
{
269
- mErrorMsg = errMsg;
274
+ mErrorMsg += " \n " ;
275
+ mErrorMsg += errMsg;
270
276
sqlite3_free ( errMsg );
271
277
}
272
278
return false ;
@@ -341,7 +347,7 @@ bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface( sqlite3 * handle, b
341
347
case GAIA_VECTOR_GEOMETRYCOLLECTION:
342
348
type = tr ( " GEOMETRYCOLLECTION" );
343
349
break ;
344
- };
350
+ }
345
351
mTables .append ( TableEntry ( tableName, column, type ) );
346
352
347
353
lyr = lyr->Next ;
@@ -683,7 +689,7 @@ bool QgsSpatiaLiteConnection::isDeclaredHidden( sqlite3 * handle, QString table,
683
689
error:
684
690
// unexpected IO error
685
691
mErrorMsg = tr ( " unknown error cause" );
686
- if ( errMsg != NULL )
692
+ if ( errMsg )
687
693
{
688
694
mErrorMsg = errMsg;
689
695
sqlite3_free ( errMsg );
0 commit comments