LSErrorCode Enumeration¶
-
class
localsolver.LSErrorCode¶ List of error codes used by py:class:LSError.
As other enumerations present in the localsolver module, LSErrorCode is enumerable and indexable:
print (LSErrorCode[0]) # Shows LSErrorCode.API print (LSErrorCode.API.value) # Shows 0 # Iterates over the members of LSErrorCode for e in LSErrorCode: print e
-
API¶ Code used for errors related to API functions. Used when you call a function in a wrong way or with inappropriate parameters.
Examples of error messages:
- Argument
arg namecannot be null. - Argument
arg namedoes not belong to this instance of LocalSolver. - Argument
arg namemust be positive. - Argument
arg namecannot be an empty string. - This method is only allowed in state Modeling (the model must not be closed).
- Argument
-
FILE¶ Code used when an error related to input/output operations occurs.
Examples of error messages:
- File doesn’t exist.
- File is corrupted.
- Cannot open file.
- File format is not recognized.
-
MODEL¶ Code used when a problem related to the structure of the model occurs.
Examples of error messages:
- At least one objective is required in the model.
- A cycle of length
nwas detected in the model. - Number of operands (
n) is too small: at leastmoperands are expected foroperator. - Operand
nofoperatormust betype. Type provided:other type.
-
CALLBACK¶ Code used when an error is encountered in a user callback.
-
LICENSE¶ Code used when a problem related to licensing occurs. That could be a problem with the license itself (expiration, hardware signature, ...), or a problem related to input/output or networking operations.
Examples of error messages:
- Incorrect license number.
- This license key is not compatible with the current hardware. Please contact your reseller.
- Property
propis missing in file[file]. - Fail to contact the token server. Check your connection.
- This license is not compatible with the current hardware.
- No token available. All tokens are currently in use.
-
SOLVER¶ Code used when a problem occurs during the resolution.
-
INTERNAL¶ Internal LocalSolver error.
-
MODELER¶ Code used when an error is encountered in the modeler.
-