mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60975c9596 |
@@ -12,6 +12,7 @@
|
|||||||
#include "configurators/wireguard_configurator.h"
|
#include "configurators/wireguard_configurator.h"
|
||||||
#include "core/enums/apiEnums.h"
|
#include "core/enums/apiEnums.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "utilities.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -362,6 +363,7 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
|
|||||||
publicKey = rsa.getPublicKeyFromByteArray(key);
|
publicKey = rsa.getPublicKeyFromByteArray(key);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
qCritical() << "error loading public key from environment variables";
|
qCritical() << "error loading public key from environment variables";
|
||||||
|
Utils::logException();
|
||||||
return ErrorCode::ApiMissingAgwPublicKey;
|
return ErrorCode::ApiMissingAgwPublicKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,25 @@ QString Utils::tun2socksPath()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Utils::logException(const std::exception &e)
|
||||||
|
{
|
||||||
|
qCritical() << e.what();
|
||||||
|
try {
|
||||||
|
std::rethrow_if_nested(e);
|
||||||
|
} catch (const std::exception &nested) {
|
||||||
|
logException(nested);
|
||||||
|
} catch (...) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Utils::logException(const std::exception_ptr &eptr)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (eptr) std::rethrow_exception(eptr);
|
||||||
|
} catch (const std::exception &e) {
|
||||||
|
logException(e);
|
||||||
|
} catch (...) {}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// Inspired from http://stackoverflow.com/a/15281070/1529139
|
// Inspired from http://stackoverflow.com/a/15281070/1529139
|
||||||
// and http://stackoverflow.com/q/40059902/1529139
|
// and http://stackoverflow.com/q/40059902/1529139
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ public:
|
|||||||
static QString certUtilPath();
|
static QString certUtilPath();
|
||||||
static QString tun2socksPath();
|
static QString tun2socksPath();
|
||||||
|
|
||||||
|
static void logException(const std::exception &e);
|
||||||
|
static void logException(const std::exception_ptr &eptr = std::current_exception());
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
static bool signalCtrl(DWORD dwProcessId, DWORD dwCtrlEvent);
|
static bool signalCtrl(DWORD dwProcessId, DWORD dwCtrlEvent);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user