Log GpgME errors.

In file WT_APP_ROOT/gpgme.log.

Independently of usual Wt logging.
This commit is contained in:
SET
2020-11-23 20:34:11 +01:00
parent b726b89086
commit e14a5c19f4
8 changed files with 68 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
#include "Tools.h"
#include <Wt/WLink.h>
#include <strstream>
#include "GpgMELogger.h"
using namespace std;
@@ -80,6 +81,7 @@ void KeyringIO::DoImportKey()
if (e.code() != 0)
{
m_tmwMessage->SetText(e.asString());
LGE(e);
return;
}
if (fpr.empty())
@@ -92,6 +94,7 @@ void KeyringIO::DoImportKey()
if (e.code() != 0)
{
m_tmwMessage->SetText(e.asString());
LGE(e);
return;
}
m_tmwMessage->SetText(TR("ImportSuccess") + fpr + WString(" - ") + WString(k.userID(0).name()));
@@ -110,6 +113,7 @@ bool KeyringIO::CanKeyBeDeleted(const WString& fullKeyID)
if (e.code() != 0 && e.code() != 16383)
{ // 16383 : end of file, when key is not private
m_tmwMessage->SetText(e.asString());
LGE(e);
return false;
}
// k can now be secret or public
@@ -167,6 +171,7 @@ void KeyringIO::DoDeleteKey()
if (e.code() != 0)
{
m_tmwMessage->SetText(e.asString());
LGE(e);
return;
}
// Delete the key using the C API
@@ -233,6 +238,7 @@ void KeyringIO::DoCreateKey()
if (e.code() != 0)
{
m_tmwMessage->SetText(e.asString());
LGE(e);
}
else
{
@@ -311,6 +317,7 @@ void ExportKeyStreamResource::handleRequest(const Http::Request& request,
if (e.code() != 0)
{
m_tmwMessage->SetText(e.asString());
LGE(e);
return;
}
suggestFileName(m_fpr + WString(".asc"), ContentDisposition::Attachment);