exceptions#
Exception classes for GAMSPy
- exception gamspy.exceptions.EngineClientException[source]#
Bases:
GamspyBaseExceptionEngineClient exception
- exception gamspy.exceptions.EngineException(message: str, return_code: int, status_code: int | None = None)[source]#
Bases:
GamspyExceptionGAMS Engine execution exception.
- Parameters:
- messagestr
- return_codeint
- status_codeint | None, optional
- exception gamspy.exceptions.FatalError[source]#
Bases:
GamspyBaseExceptionIndicates an error that cannot be recovered from. This error should never be caught.
- exception gamspy.exceptions.GamspyBaseException[source]#
Bases:
ExceptionBase class of every exception GAMSPy raises.
Catch this to handle any GAMSPy failure without enumerating the individual exception types:
try: model.solve() except GamspyBaseException as e: ...
It does not carry any behavior of its own, so no subclass is forced to accept a particular constructor signature. Prefer a narrower type when you know which failure you want to handle.
- exception gamspy.exceptions.GamspyException(message: str, return_code: int | None = None)[source]#
Bases:
GamspyBaseExceptionAn error raised while GAMS executed the generated model. This exception can be caught and GAMSPy should be able to continue. It deliberately does not cover validation, GDX or client errors; catch
GamspyBaseExceptionfor those as well.- Parameters:
- messagestr
- return_codeint | None
- exception gamspy.exceptions.GdxException[source]#
Bases:
GamspyBaseExceptionGDX exception
- exception gamspy.exceptions.GmdException[source]#
Bases:
GamspyBaseExceptionGMD exception
- exception gamspy.exceptions.LatexException(message: str, return_code: int | None = None)[source]#
Bases:
GamspyExceptionTo latex execution exception
- exception gamspy.exceptions.NeosClientException[source]#
Bases:
GamspyBaseExceptionNeosClient exception
- exception gamspy.exceptions.NeosException(message: str, return_code: int | None = None)[source]#
Bases:
GamspyExceptionNEOS Server execution exception
- exception gamspy.exceptions.ValidationError[source]#
Bases:
GamspyBaseExceptionAn error while validating data.