Error Types
- exception titanq.errors.BadRequest(message: str = '', computation_id: str | None = None)
The request sent to TitanQ is not valid
- exception titanq.errors.ClientError(message: str = '', computation_id: str | None = None)
Base client-side http error
- exception titanq.errors.ComputationFailedError(message: str = '', computation_id: str | None = None)
The computation failed
- exception titanq.errors.ConnectionError(message: str = '', computation_id: str | None = None)
Error due to a connection issue with an external resource
- exception titanq.errors.ConstraintAlreadySetError(message: str = '', computation_id: str | None = None)
A constraint has already been set
- exception titanq.errors.ConstraintSizeError(message: str = '', computation_id: str | None = None)
Unexpected number of constraints
- exception titanq.errors.ContradictoryExpressionError(message='The provided expression is contradictory and always evaluates to False, regardless of the variable values.', *args, **kwargs)
Exception raised when an expression is contradictory (always false).
This exception indicates that the provided expression is invalid as it represents an impossible condition.
- exception titanq.errors.EmptyResultError(message: str = '', computation_id: str | None = None)
Results were downloaded but they are empty
- exception titanq.errors.MissingFinishedStatusError(message: str = '', computation_id: str | None = None)
The computation does not include a finished status
- exception titanq.errors.MissingObjectiveError(message: str = '', computation_id: str | None = None)
Objective has not already been registered
- exception titanq.errors.MissingTitanqApiKey(message: str = '', computation_id: str | None = None)
TitanQ Api key is missing
- exception titanq.errors.MissingVariableError(message: str = '', computation_id: str | None = None)
Variable has not already been registered
- exception titanq.errors.MpsConfiguredModelError(message: str = '', computation_id: str | None = None)
Passed model is already configured
- exception titanq.errors.MpsMalformedFileError(message: str = '', computation_id: str | None = None)
The file is malformed
- exception titanq.errors.MpsMissingSectionError(message: str = '', computation_id: str | None = None)
A required section is missing
- exception titanq.errors.MpsMissingValueError(message: str = '', computation_id: str | None = None)
A required value is missing
- exception titanq.errors.MpsParsingError(message: str = '', computation_id: str | None = None)
Base class for any error related to the MPS files parsing module
- exception titanq.errors.MpsUnexpectedValueError(message: str = '', computation_id: str | None = None)
Found an unexpected value
- exception titanq.errors.MpsUnsupportedError(message: str = '', computation_id: str | None = None)
Found an unsupported value
- exception titanq.errors.NotEnoughCreditsError(message='Not enough credits left', *args, **kwargs)
Not enough credits left
- exception titanq.errors.ObjectiveAlreadySetError(message: str = '', computation_id: str | None = None)
An objective has already been set
- exception titanq.errors.ServerError(message: str = '', computation_id: str | None = None)
Unexpected condition prevented the TitanQ server to fulfill the request
- exception titanq.errors.TautologicalExpressionError(message='The provided expression is tautological and always evaluates to True, regardless of the variable values.', *args, **kwargs)
Exception raised when an expression is tautological (always true).
This exception indicates that the provided expression is redundant and does not add meaningful constraints or information.
- exception titanq.errors.TitanqError(message: str = '', computation_id: str | None = None)
Base TitanQ error, optionally can be instantiated with a computation id
- exception titanq.errors.UnexpectedServerResponseError(message: str = '', computation_id: str | None = None)
Response from the TitanQ server is not as expected
- exception titanq.errors.UnknownError(message='TitanQ has experienced an unknown error, please contact (support@infinityq.tech).', *args, **kwargs)
An error happened in TitanQ, but the SDK is unable to know what is the source of the problem.
- exception titanq.errors.UnsolvableRequestError(message='TitanQ cannot solve this combination of parameters', *args, **kwargs)
TitanQ cannot solve this combination of parameters
- exception titanq.errors.VariableAlreadyExist(message: str = '', computation_id: str | None = None)
Variable with the same name already exist
- titanq.errors.contextmanager(func)
@contextmanager decorator.
Typical usage:
@contextmanager def some_generator(<arguments>):
<setup> try:
yield <value>
- finally:
<cleanup>
This makes this:
- with some_generator(<arguments>) as <variable>:
<body>
equivalent to this:
<setup> try:
<variable> = <value> <body>
- finally:
<cleanup>
- titanq.errors.titanq_error_including_computation_id(id: str)
Computation manager that will include a ‘TitanqError’ with a computation id