Skip to content

Commit

Permalink
Merge pull request #18 from cryptlex/muneeb/status-codes
Browse files Browse the repository at this point in the history
feat: add status codes
  • Loading branch information
ahmad-kemsan authored Aug 6, 2024
2 parents a7dc774 + 0cb9609 commit 8f456ca
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
16 changes: 16 additions & 0 deletions cryptlex/lexfloatclient/lexfloatclient_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,20 @@ def get_error_message(code):
return 'The server license has been suspended.'
if code == LexFloatStatusCodes.LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER:
return 'The grace period for server license is over.'
if code == LexFloatStatusCodes.LF_E_SYSTEM_PERMISSION:
return 'Insufficient system permissions.'
if code == LexFloatStatusCodes.LF_E_INVALID_PERMISSION_FLAG:
return 'Invalid permission flag.'
if code == LexFloatStatusCodes.LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED:
return 'Offline floating license is not allowed for per-instance leasing strategy.'
if code == LexFloatStatusCodes.LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED:
return 'Maximum offline lease duration exceeded.'
if code == LexFloatStatusCodes.LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED:
return 'Allowed offline floating clients limit reached.'
if code == LexFloatStatusCodes.LF_E_WMIC:
return "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled. This error is specific to Windows only."
if code == LexFloatStatusCodes.LF_E_MACHINE_FINGERPRINT:
return 'Machine fingerprint has changed since activation.'
if code == LexFloatStatusCodes.LF_E_PROXY_NOT_TRUSTED:
return 'Request blocked due to untrusted proxy.'
return 'Unknown error!'
20 changes: 18 additions & 2 deletions cryptlex/lexfloatclient/lexfloatstatus_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,26 @@ class LexFloatStatusCodes:
LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56

LF_E_PRODUCT_VERSION_NOT_LINKED = 57

LF_E_FEATURE_FLAG_NOT_FOUND = 58


LF_E_SYSTEM_PERMISSION = 59

LF_E_IP = 60

LF_E_INVALID_PERMISSION_FLAG = 61

LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62

LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63

LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64

LF_E_WMIC = 65

LF_E_MACHINE_FINGERPRINT = 66

LF_E_PROXY_NOT_TRUSTED = 67

LF_E_CLIENT = 70

Expand Down

0 comments on commit 8f456ca

Please sign in to comment.