mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
bcee58b08b
* test capcha * add test AMNEZIA_GATEWAY_PLAINTEXT_MOCK * ref * remove first QNetworkReply::NoError * fixed macros * fixed http code * add test server * fix cmake * add CAPTCHA refreshed * fixed captcha * update QML Captha * fixed crash app & up vercion & fix qml captha * ver 4.9.0.1 * remove m_gatewayCaptchaStickyBase & outEffectiveRequestBase * reset code PR * remove mock & temp var AMNEZIA_LOCAL_GATEWAY * ref code & remove AMNEZIA_LOCAL_GATEWAY * remove check httpStatusCode & error * add 408 status code * fix update captca * remove fallback на transport * chore: add loader after captcha solved * chore: remove logs from api utils * chore: minor fixes --------- Co-authored-by: vkamn <vk@amnezia.org>
128 lines
3.6 KiB
C++
128 lines
3.6 KiB
C++
#ifndef ERRORCODES_H
|
|
#define ERRORCODES_H
|
|
|
|
#include <QMetaEnum>
|
|
#include <QObject>
|
|
|
|
namespace amnezia
|
|
{
|
|
namespace error_code_ns
|
|
{
|
|
Q_NAMESPACE
|
|
// TODO: change to enum class
|
|
enum ErrorCode {
|
|
// General error codes
|
|
NoError = 0,
|
|
UnknownError = 100,
|
|
InternalError = 101,
|
|
NotImplementedError = 102,
|
|
AmneziaServiceNotRunning = 103,
|
|
NotSupportedOnThisPlatform = 104,
|
|
|
|
// Server errors
|
|
ServerCheckFailed = 200,
|
|
ServerPortAlreadyAllocatedError = 201,
|
|
ServerContainerMissingError = 202,
|
|
ServerDockerFailedError = 203,
|
|
ServerCancelInstallation = 204,
|
|
ServerUserNotInSudo = 205,
|
|
ServerPacketManagerError = 206,
|
|
ServerSudoPackageIsNotPreinstalled = 207,
|
|
ServerUserDirectoryNotAccessible = 208,
|
|
ServerUserNotAllowedInSudoers = 209,
|
|
ServerUserPasswordRequired = 210,
|
|
ServerDockerOnCgroupsV2 = 211,
|
|
ServerCgroupMountpoint = 212,
|
|
DockerPullRateLimit = 213,
|
|
ServerLinuxKernelTooOld = 214,
|
|
XrayServerConfigInvalid = 215,
|
|
XrayServerNoVlessClients = 216,
|
|
XrayRealityKeysReadFailed = 217,
|
|
|
|
// Ssh connection errors
|
|
SshRequestDeniedError = 300,
|
|
SshInterruptedError = 301,
|
|
SshInternalError = 302,
|
|
SshPrivateKeyError = 303,
|
|
SshPrivateKeyFormatError = 304,
|
|
SshTimeoutError = 305,
|
|
|
|
// Ssh scp errors
|
|
SshScpFailureError = 400,
|
|
|
|
// Local errors
|
|
OpenVpnConfigMissing = 500,
|
|
OpenVpnManagementServerError = 501,
|
|
|
|
// Distro errors
|
|
OpenVpnExecutableMissing = 600,
|
|
AmneziaServiceConnectionFailed = 603,
|
|
ExecutableMissing = 604,
|
|
XrayExecutableMissing = 605,
|
|
Tun2SockExecutableMissing = 606,
|
|
|
|
// VPN errors
|
|
OpenVpnAdaptersInUseError = 700,
|
|
OpenVpnUnknownError = 701,
|
|
OpenVpnTapAdapterError = 702,
|
|
AddressPoolError = 703,
|
|
|
|
// 3rd party utils errors
|
|
OpenSslFailed = 800,
|
|
XrayExecutableCrashed = 803,
|
|
Tun2SockExecutableCrashed = 804,
|
|
|
|
// import and install errors
|
|
ImportInvalidConfigError = 900,
|
|
ImportOpenConfigError = 901,
|
|
NoInstalledContainersError = 902,
|
|
ImportBackupFileUseRestoreInstead = 903,
|
|
RestoreBackupInvalidError = 904,
|
|
LegacyApiV1NotSupportedError = 905,
|
|
|
|
// Android errors
|
|
AndroidError = 1000,
|
|
|
|
// Api errors
|
|
ApiConfigDownloadError = 1100,
|
|
ApiConfigAlreadyAdded = 1101,
|
|
ApiConfigEmptyError = 1102,
|
|
ApiConfigTimeoutError = 1103,
|
|
ApiConfigSslError = 1104,
|
|
ApiMissingAgwPublicKey = 1105,
|
|
ApiConfigDecryptionError = 1106,
|
|
ApiServicesMissingError = 1107,
|
|
ApiConfigLimitError = 1108,
|
|
ApiNotFoundError = 1109,
|
|
ApiMigrationError = 1110,
|
|
ApiUpdateRequestError = 1111,
|
|
ApiSubscriptionExpiredError = 1112,
|
|
ApiPurchaseError = 1113,
|
|
ApiSubscriptionNotActiveError = 1114,
|
|
ApiNoPurchasedSubscriptionsError = 1115,
|
|
ApiTrialAlreadyUsedError = 1116,
|
|
ApiCaptchaRequiredError = 1117,
|
|
ApiCaptchaInvalidError = 1118,
|
|
ApiCaptchaRefreshError = 1119,
|
|
ApiRateLimitError = 1120,
|
|
|
|
// QFile errors
|
|
OpenError = 1200,
|
|
ReadError = 1201,
|
|
PermissionsError = 1202,
|
|
UnspecifiedError = 1203,
|
|
FatalError = 1204,
|
|
AbortError = 1205
|
|
};
|
|
Q_ENUM_NS(ErrorCode)
|
|
}
|
|
|
|
using ErrorCode = error_code_ns::ErrorCode;
|
|
}
|
|
|
|
Q_DECLARE_METATYPE(amnezia::ErrorCode)
|
|
|
|
#endif // ERRORCODES_H
|
|
|
|
|