Files
amnezia-client/client/core/utils/errorCodes.h
T

128 lines
3.6 KiB
C++
Raw Normal View History

#ifndef ERRORCODES_H
#define ERRORCODES_H
2021-01-06 17:12:24 +03:00
2021-04-20 02:09:47 +03:00
#include <QMetaEnum>
2021-01-06 17:12:24 +03:00
#include <QObject>
2023-12-24 21:11:47 +07:00
namespace amnezia
2021-01-06 17:12:24 +03:00
{
2024-05-25 13:00:51 +03:00
namespace error_code_ns
{
Q_NAMESPACE
// TODO: change to enum class
enum ErrorCode {
2023-12-24 21:11:47 +07:00
// General error codes
NoError = 0,
2024-01-29 21:33:35 +07:00
UnknownError = 100,
InternalError = 101,
NotImplementedError = 102,
AmneziaServiceNotRunning = 103,
NotSupportedOnThisPlatform = 104,
2023-12-24 21:11:47 +07:00
// Server errors
2024-01-29 21:33:35 +07:00
ServerCheckFailed = 200,
ServerPortAlreadyAllocatedError = 201,
ServerContainerMissingError = 202,
ServerDockerFailedError = 203,
ServerCancelInstallation = 204,
ServerUserNotInSudo = 205,
ServerPacketManagerError = 206,
2025-03-20 07:24:37 +04:00
ServerSudoPackageIsNotPreinstalled = 207,
ServerUserDirectoryNotAccessible = 208,
ServerUserNotAllowedInSudoers = 209,
ServerUserPasswordRequired = 210,
2025-04-23 09:12:23 +04:00
ServerDockerOnCgroupsV2 = 211,
ServerCgroupMountpoint = 212,
2025-06-23 06:32:56 +04:00
DockerPullRateLimit = 213,
ServerLinuxKernelTooOld = 214,
2026-05-28 07:21:46 +03:00
XrayServerConfigInvalid = 215,
XrayServerNoVlessClients = 216,
XrayRealityKeysReadFailed = 217,
2023-12-24 21:11:47 +07:00
// Ssh connection errors
2024-01-29 21:33:35 +07:00
SshRequestDeniedError = 300,
SshInterruptedError = 301,
SshInternalError = 302,
SshPrivateKeyError = 303,
SshPrivateKeyFormatError = 304,
SshTimeoutError = 305,
2023-12-24 21:11:47 +07:00
2024-03-06 02:24:28 +01:00
// Ssh scp errors
SshScpFailureError = 400,
2023-12-24 21:11:47 +07:00
// Local errors
2024-01-29 21:33:35 +07:00
OpenVpnConfigMissing = 500,
OpenVpnManagementServerError = 501,
2023-12-24 21:11:47 +07:00
// Distro errors
2024-01-29 21:33:35 +07:00
OpenVpnExecutableMissing = 600,
AmneziaServiceConnectionFailed = 603,
ExecutableMissing = 604,
2024-03-27 11:02:34 +00:00
XrayExecutableMissing = 605,
2024-05-25 13:00:51 +03:00
Tun2SockExecutableMissing = 606,
2023-12-24 21:11:47 +07:00
// VPN errors
2024-01-29 21:33:35 +07:00
OpenVpnAdaptersInUseError = 700,
OpenVpnUnknownError = 701,
OpenVpnTapAdapterError = 702,
AddressPoolError = 703,
2023-12-24 21:11:47 +07:00
// 3rd party utils errors
2024-01-29 21:33:35 +07:00
OpenSslFailed = 800,
2024-03-27 11:02:34 +00:00
XrayExecutableCrashed = 803,
Tun2SockExecutableCrashed = 804,
2023-12-24 21:11:47 +07:00
// import and install errors
2024-01-29 21:33:35 +07:00
ImportInvalidConfigError = 900,
ImportOpenConfigError = 901,
NoInstalledContainersError = 902,
ImportBackupFileUseRestoreInstead = 903,
RestoreBackupInvalidError = 904,
LegacyApiV1NotSupportedError = 905,
2023-12-24 21:11:47 +07:00
// Android errors
2024-02-09 23:23:26 +05:00
AndroidError = 1000,
// Api errors
ApiConfigDownloadError = 1100,
2024-03-06 02:24:28 +01:00
ApiConfigAlreadyAdded = 1101,
ApiConfigEmptyError = 1102,
ApiConfigTimeoutError = 1103,
ApiConfigSslError = 1104,
ApiMissingAgwPublicKey = 1105,
2024-10-18 13:57:38 +04:00
ApiConfigDecryptionError = 1106,
ApiServicesMissingError = 1107,
ApiConfigLimitError = 1108,
ApiNotFoundError = 1109,
2025-05-13 12:29:33 +08:00
ApiMigrationError = 1110,
2025-05-23 14:53:55 +08:00
ApiUpdateRequestError = 1111,
ApiSubscriptionExpiredError = 1112,
2025-12-18 16:36:12 +02:00
ApiPurchaseError = 1113,
2026-04-08 11:21:12 +07:00
ApiSubscriptionNotActiveError = 1114,
ApiNoPurchasedSubscriptionsError = 1115,
ApiTrialAlreadyUsedError = 1116,
2026-05-28 08:51:26 +03:00
ApiCaptchaRequiredError = 1117,
ApiCaptchaInvalidError = 1118,
ApiCaptchaRefreshError = 1119,
ApiRateLimitError = 1120,
2024-03-06 02:24:28 +01:00
// QFile errors
OpenError = 1200,
ReadError = 1201,
PermissionsError = 1202,
UnspecifiedError = 1203,
FatalError = 1204,
AbortError = 1205
2024-05-25 13:00:51 +03:00
};
Q_ENUM_NS(ErrorCode)
}
using ErrorCode = error_code_ns::ErrorCode;
}
2021-01-06 17:12:24 +03:00
2021-09-30 15:56:48 +03:00
Q_DECLARE_METATYPE(amnezia::ErrorCode)
#endif // ERRORCODES_H