mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-20 18:06:13 +03:00
Compare commits
1 Commits
patch/user
...
feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60975c9596 |
@@ -12,6 +12,7 @@
|
||||
#include "configurators/wireguard_configurator.h"
|
||||
#include "core/enums/apiEnums.h"
|
||||
#include "version.h"
|
||||
#include "utilities.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -362,6 +363,7 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
|
||||
publicKey = rsa.getPublicKeyFromByteArray(key);
|
||||
} catch (...) {
|
||||
qCritical() << "error loading public key from environment variables";
|
||||
Utils::logException();
|
||||
return ErrorCode::ApiMissingAgwPublicKey;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,6 +211,25 @@ QString Utils::tun2socksPath()
|
||||
#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
|
||||
// Inspired from http://stackoverflow.com/a/15281070/1529139
|
||||
// and http://stackoverflow.com/q/40059902/1529139
|
||||
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
static QString certUtilPath();
|
||||
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
|
||||
static bool signalCtrl(DWORD dwProcessId, DWORD dwCtrlEvent);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user