Skip to content

Commit

Permalink
Merge pull request #37 from cryptlex/muneeb/status-code
Browse files Browse the repository at this point in the history
feat: add new error codes
  • Loading branch information
ahmad-kemsan authored Aug 6, 2024
2 parents 1fbf57c + 7d5395f commit 8840855
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/lexfloatclient-exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,31 @@ export class LexFloatClientException extends Error {
case LexFloatStatusCodes.LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER:
message = "The grace period for server license is over.";
break;
case LexFloatStatusCodes.LF_E_SYSTEM_PERMISSION:
message = "Insufficient system permissions.";
break;
case LexFloatStatusCodes.LF_E_INVALID_PERMISSION_FLAG:
message = "Invalid permission flag.";
break;

case LexFloatStatusCodes.LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED:
message = "Offline floating license is not allowed for per-instance leasing strategy.";
break;
case LexFloatStatusCodes.LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED:
message = "Maximum offline lease duration exeeded.";
break;
case LexFloatStatusCodes.LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED:
message = "Allowed offline floating clients limit reached.";
break;
case LexFloatStatusCodes.LF_E_WMIC:
message = "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled. This error is specific to Windows only";
break;
case LexFloatStatusCodes.LF_E_MACHINE_FINGERPRINT:
message = "Machine fingerprint has changed since activation.";
break;
case LexFloatStatusCodes.LF_E_PROXY_NOT_TRUSTED:
message = "Request blocked due to untrusted proxy.";
break;
default:
message = 'Unknown error!';
}
Expand Down
42 changes: 42 additions & 0 deletions src/lexfloatstatus-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,53 @@ export const LexFloatStatusCodes = {
*/
LF_E_FEATURE_FLAG_NOT_FOUND: 58,

/**
* Insufficient system permissions.
*/
LF_E_SYSTEM_PERMISSION: 59,

/**
* IP address is not allowed.
*/
LF_E_IP: 60,

/**
* Invalid permission flag.
*/
LF_E_INVALID_PERMISSION_FLAG: 61,

/**
* Offline floating license is not allowed for per-instance leasing strategy.
*/
LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED: 62,

/**
* Maximum offline lease duration exeeded.
*/

LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED: 63,

/**
* Allowed offline floating clients limit reached.
*/
LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED: 64,

/**
* Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled.
* This error is specific to Windows only.
*/
LF_E_WMIC : 65,

/**
* Machine fingerprint has changed since activation.
*/
LF_E_MACHINE_FINGERPRINT : 66,

/**
* Request blocked due to untrusted proxy.
*/
LF_E_PROXY_NOT_TRUSTED : 67,

/**
* Client error.
*/
Expand Down
58 changes: 58 additions & 0 deletions src/native/LexFloatStatusCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,70 @@ enum LexFloatStatusCodes
*/
LF_E_FEATURE_FLAG_NOT_FOUND = 58,

/*
CODE: LF_E_SYSTEM_PERMISSION
MESSAGE: Insufficient system permissions.
*/
LF_E_SYSTEM_PERMISSION = 59,

/*
CODE: LF_E_IP
MESSAGE: IP address is not allowed.
*/
LF_E_IP = 60,

/*
CODE: LF_E_INVALID_PERMISSION_FLAG
MESSAGE: Invalid permission flag.
*/
LF_E_INVALID_PERMISSION_FLAG = 61,

/*
CODE: LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED
MESSAGE: Offline floating license is not allowed for per-instance leasing strategy.
*/
LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62,

/*
CODE: LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED
MESSAGE: Maximum offline lease duration exeeded.
*/
LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63,

/*
CODE: LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED
MESSAGE: Allowed offline floating clients limit reached.
*/
LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64,

/*
CODE: LF_E_WMIC
MESSAGE: Fingerprint couldn't be generated because Windows Management
Instrumentation (WMI) service has been disabled. This error is specific
to Windows only.
*/
LF_E_WMIC = 65,

/*
CODE: LF_E_MACHINE_FINGERPRINT
MESSAGE: Machine fingerprint has changed since activation.
*/
LF_E_MACHINE_FINGERPRINT = 66,

/*
CODE: LF_E_PROXY_NOT_TRUSTED
MESSAGE: Request blocked due to untrusted proxy.
*/
LF_E_PROXY_NOT_TRUSTED = 67,

/*
CODE: LF_E_CLIENT
MESSAGE: Client error.
Expand Down

0 comments on commit 8840855

Please sign in to comment.