Skip to content

Commit

Permalink
PMR support: now provide a more meaningful error message when somethi…
Browse files Browse the repository at this point in the history
…ng goes wrong (closes #1558).
  • Loading branch information
agarny committed Mar 16, 2018
2 parents 7632e43 + 308e066 commit 623575b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/downloads/index.js
Expand Up @@ -37,7 +37,7 @@ var jsonData = { "versions": [
}
],
"changes": [
{ "change": "<strong>PMR support:</strong> fixed a problem with folders being potentially incorrectly tracked (see issue <a href=\"https://github.com/opencor/opencor/issues/1559\">#1559</a>)." },
{ "change": "<strong>PMR support:</strong> now provide a more meaningful error message when something goes wrong (see issue <a href=\"https://github.com/opencor/opencor/issues/1558\">#1558</a>). Fixed a problem with folders being potentially incorrectly tracked (see issue <a href=\"https://github.com/opencor/opencor/issues/1559\">#1559</a>)." },
{ "change": "<strong>Simulation Experiment view:</strong> fixed a small regression problem with nothing being shown when running a simulation and then asking for a graph to be plotted (see issue <a href=\"https://github.com/opencor/opencor/issues/1560\">#1560</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded <a href=\"https://libgit2.github.com/\">libgit2</a> to version 0.26.3 (see issue <a href=\"https://github.com/opencor/opencor/issues/1557\">#1557</a>)." }
]
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/support/PMRSupport/i18n/PMRSupport_fr.ts
Expand Up @@ -147,6 +147,14 @@
<source>An error occurred while trying to push the workspace.</source>
<translation>Une erreur s&apos;est produite lors du poussage de l&apos;espace de travail.</translation>
</message>
<message>
<source>%1

Git message: %2.</source>
<translation>%1

Message Git : %2.</translation>
</message>
</context>
<context>
<name>PmrSupportPreferencesWidget</name>
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/support/PMRSupport/src/pmrworkspace.cpp
Expand Up @@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// PMR workspace
//==============================================================================

#include "corecliutils.h"
#include "pmrsupportpreferenceswidget.h"
#include "pmrwebservice.h"
#include "pmrworkspace.h"
Expand Down Expand Up @@ -1344,7 +1345,12 @@ void PmrWorkspace::emitGitError(const QString &pMessage) const
{
// Let people know, through a warning, about our Git error

emit warning(pMessage);
const git_error *gitError = giterr_last();

if (gitError)
emit warning(tr("%1\n\nGit message: %2.").arg(pMessage, Core::formatMessage(gitError->message)));
else
emit warning(pMessage);
}

//==============================================================================
Expand Down

0 comments on commit 623575b

Please sign in to comment.