Skip to content

Commit bcc83e0

Browse files
wonder-sknyalldawson
authored andcommittedNov 9, 2022
Improve error reporting when loading of project file fails
- on XML reading error, the message had the project file name mentioned twice for no reason - for zipped (.qgz) project files, the underlying error message was getting lost - only saying that unzipped project file has failed to load
1 parent a58bda9 commit bcc83e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/project/qgsproject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ bool QgsProject::readProjectFile( const QString &filename, Qgis::ProjectReadFlag
15511551

15521552
projectFile.close();
15531553

1554-
setError( tr( "%1 for file %2" ).arg( errorString, projectFile.fileName() ) );
1554+
setError( errorString );
15551555

15561556
return false;
15571557
}
@@ -3766,7 +3766,7 @@ bool QgsProject::unzip( const QString &filename, Qgis::ProjectReadFlags flags )
37663766
// read the project file
37673767
if ( ! readProjectFile( static_cast<QgsProjectArchive *>( mArchive.get() )->projectFile(), flags ) )
37683768
{
3769-
setError( tr( "Cannot read unzipped qgs project file" ) );
3769+
setError( tr( "Cannot read unzipped qgs project file" ) + QStringLiteral( ": " ) + error() );
37703770
return false;
37713771
}
37723772

0 commit comments

Comments
 (0)
Please sign in to comment.