Skip to content

Commit

Permalink
Improve error reporting when loading of project file fails
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
wonder-sk authored and github-actions[bot] committed Nov 9, 2022
1 parent 5365d5f commit 70216f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/project/qgsproject.cpp
Expand Up @@ -1402,7 +1402,7 @@ bool QgsProject::readProjectFile( const QString &filename, QgsProject::ReadFlags

projectFile.close();

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

return false;
}
Expand Down Expand Up @@ -3393,7 +3393,7 @@ bool QgsProject::unzip( const QString &filename, QgsProject::ReadFlags flags )
// read the project file
if ( ! readProjectFile( static_cast<QgsProjectArchive *>( mArchive.get() )->projectFile(), flags ) )
{
setError( tr( "Cannot read unzipped qgs project file" ) );
setError( tr( "Cannot read unzipped qgs project file" ) + QStringLiteral( ": " ) + error() );
return false;
}

Expand Down

0 comments on commit 70216f5

Please sign in to comment.