Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Server] Print an error message, on project load error #8006

Merged
merged 1 commit into from Sep 25, 2018

Conversation

sbrunner
Copy link
Contributor

@sbrunner sbrunner commented Sep 24, 2018

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and contain sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@@ -47,6 +47,10 @@ const QgsProject *QgsConfigCache::project( const QString &path )
mProjectCache.insert( path, prj.release() );
mFileSystemWatcher.addPath( path );
}
else
{
QgsMessageLog::logMessage( "Error, project file '" + path + "': " + prj->error(), QStringLiteral( "Server" ), Qgis::Critical );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better translate this and use a template based approach.

tr( "Error when loading project file '%1': %2 " ).arg( ... )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any translated log message on QGIS server, and I think that better to keep it like it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But any messages coming from the qgis_core library will be translated. So it's expected to have a mix of translated and untranslated messages in the server logs? Sorry to open up this question here ;) Any other server devs with an opinion on this matter (@rldhont @elpaso @dmarteau others?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that error messages should be translated, but not OGC exceptions (defined as is in the standard).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK..., Than I will do it :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Now for the fun part, arg() takes multiple parameters and is more performant in this case so it's good practice to use it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks, updated :-)

@sbrunner sbrunner changed the title Print an error message, on project load error [Server] Print an error message, on project load error Sep 25, 2018
@sbrunner sbrunner force-pushed the print-error branch 3 times, most recently from bd45a05 to 8f45f20 Compare September 25, 2018 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants