2026-04-30 14:53:03 +08:00
|
|
|
#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,
|
2024-05-10 13:06:04 +03:00
|
|
|
AmneziaServiceNotRunning = 103,
|
2025-02-15 11:50:42 +07:00
|
|
|
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,
|
2025-03-14 17:39:58 +04:00
|
|
|
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,
|
2026-01-30 08:04:27 +04:00
|
|
|
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,
|
2024-10-13 15:14:43 +04:00
|
|
|
ImportOpenConfigError = 901,
|
2025-02-15 11:50:42 +07:00
|
|
|
NoInstalledContainersError = 902,
|
2026-05-15 12:33:36 +08:00
|
|
|
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,
|
2024-05-16 06:19:56 -07:00
|
|
|
ApiConfigEmptyError = 1102,
|
|
|
|
|
ApiConfigTimeoutError = 1103,
|
|
|
|
|
ApiConfigSslError = 1104,
|
2024-08-20 16:54:05 +07:00
|
|
|
ApiMissingAgwPublicKey = 1105,
|
2024-10-18 13:57:38 +04:00
|
|
|
ApiConfigDecryptionError = 1106,
|
2024-12-09 09:32:49 +03:00
|
|
|
ApiServicesMissingError = 1107,
|
2025-02-15 13:58:48 +07:00
|
|
|
ApiConfigLimitError = 1108,
|
2025-02-23 14:26:04 +07:00
|
|
|
ApiNotFoundError = 1109,
|
2025-05-13 12:29:33 +08:00
|
|
|
ApiMigrationError = 1110,
|
2025-05-23 14:53:55 +08:00
|
|
|
ApiUpdateRequestError = 1111,
|
2025-08-26 20:31:41 +08:00
|
|
|
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,
|
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;
|
2026-04-30 14:53:03 +08:00
|
|
|
}
|
2021-01-06 17:12:24 +03:00
|
|
|
|
2021-09-30 15:56:48 +03:00
|
|
|
Q_DECLARE_METATYPE(amnezia::ErrorCode)
|
|
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
#endif // ERRORCODES_H
|
|
|
|
|
|
|
|
|
|
|