Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new error codes #37

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Please check the formatting and doc style

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