Skip to content

Commit 8f456ca

Browse files
authored
Merge pull request #18 from cryptlex/muneeb/status-codes
feat: add status codes
2 parents a7dc774 + 0cb9609 commit 8f456ca

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

cryptlex/lexfloatclient/lexfloatclient_exception.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,20 @@ def get_error_message(code):
6464
return 'The server license has been suspended.'
6565
if code == LexFloatStatusCodes.LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER:
6666
return 'The grace period for server license is over.'
67+
if code == LexFloatStatusCodes.LF_E_SYSTEM_PERMISSION:
68+
return 'Insufficient system permissions.'
69+
if code == LexFloatStatusCodes.LF_E_INVALID_PERMISSION_FLAG:
70+
return 'Invalid permission flag.'
71+
if code == LexFloatStatusCodes.LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED:
72+
return 'Offline floating license is not allowed for per-instance leasing strategy.'
73+
if code == LexFloatStatusCodes.LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED:
74+
return 'Maximum offline lease duration exceeded.'
75+
if code == LexFloatStatusCodes.LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED:
76+
return 'Allowed offline floating clients limit reached.'
77+
if code == LexFloatStatusCodes.LF_E_WMIC:
78+
return "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled. This error is specific to Windows only."
79+
if code == LexFloatStatusCodes.LF_E_MACHINE_FINGERPRINT:
80+
return 'Machine fingerprint has changed since activation.'
81+
if code == LexFloatStatusCodes.LF_E_PROXY_NOT_TRUSTED:
82+
return 'Request blocked due to untrusted proxy.'
6783
return 'Unknown error!'

cryptlex/lexfloatclient/lexfloatstatus_codes.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,26 @@ class LexFloatStatusCodes:
3939
LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56
4040

4141
LF_E_PRODUCT_VERSION_NOT_LINKED = 57
42-
42+
4343
LF_E_FEATURE_FLAG_NOT_FOUND = 58
44-
44+
45+
LF_E_SYSTEM_PERMISSION = 59
46+
4547
LF_E_IP = 60
48+
49+
LF_E_INVALID_PERMISSION_FLAG = 61
50+
51+
LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62
52+
53+
LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63
54+
55+
LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64
56+
57+
LF_E_WMIC = 65
58+
59+
LF_E_MACHINE_FINGERPRINT = 66
60+
61+
LF_E_PROXY_NOT_TRUSTED = 67
4662

4763
LF_E_CLIENT = 70
4864

0 commit comments

Comments
 (0)