Exceptions

Most package-specific exceptions inherit from JCMsuiteError. The source-related exceptions SourceMappingError, TemplateMappingError, and ConfigMappingError include source-position diagnostics. SolveExecutionError inherits from RuntimeError and reports failed local and daemon solves through one exception type. Daemon execution details are available when the solve used a daemon. Catch a specific exception when the application can recover from that failure.

class jcmsuite.exceptions.JCMsuiteError[source]

Common parent for errors reported by jcmsuite.

class jcmsuite.exceptions.BackendUnavailableError[source]

Error raised when the requested execution method is not available.

class jcmsuite.exceptions.ConfigMappingError(message, *, source=None, line=None, column=None)[source]

Error raised for a JCMsuite input error at a known source position.

Parameters:
  • message (str) – Description of the problem.

  • source (str | Path | None, optional) – Original JCMsuite input file associated with the diagnostic. For daemon execution in a separate working directory, this is the source file, not its staged copy.

  • line (int | None, optional) – One-based source line, if known.

  • column (int | None, optional) – One-based source column, if known.

class jcmsuite.exceptions.ContextConflictError[source]

Error raised when one operation receives two different contexts.

class jcmsuite.exceptions.SolveExecutionError(*, backend, exit_code, log, job_id=None, job_info=None)[source]

Error raised when a local or daemon solve fails.

Public solve and deferred-wait calls trim deep internal traceback frames before they re-raise this error. The exception and its solver diagnostics remain available to callers.

Parameters:
  • backend (Literal["local", "daemon"]) – Backend that executed the solve.

  • exit_code (int) – Exit code reported by the solver or daemon.

  • log (str) – Diagnostic text reported by the backend.

  • job_id (int | None) – Daemon job identifier, or None for a local solve.

  • job_info (Mapping[str, object] | None) – Additional daemon information, or None for a local solve.

backend

Backend that executed the solve.

Type:

Literal[“local”, “daemon”]

exit_code

Exit code reported by the solver or daemon.

Type:

int

log

Diagnostic text reported by the backend.

Type:

str

job_id

Daemon job identifier, or None for a local solve.

Type:

int | None

job_info

Additional daemon information, or None for a local solve.

Type:

dict[str, object] | None

class jcmsuite.exceptions.InvalidConfigurationError[source]

Error raised when an input or setting is not valid.

class jcmsuite.exceptions.RuntimeContextError[source]

Error raised when JCMsuite settings are missing or cannot be used.

The same exception is also exported from jcmsuite.context for context-related operations:

class jcmsuite.context.RuntimeContextError[source]

Error raised when JCMsuite settings are missing or cannot be used.

class jcmsuite.exceptions.SourceMappingError(message, *, source=None, line=None, column=None)[source]

Error raised for a problem at a known position in a source file.

Parameters:
  • message (str) – Description of the problem.

  • source (str | Path | None, optional) – Source file associated with the diagnostic.

  • line (int | None, optional) – One-based source line, if known.

  • column (int | None, optional) – One-based source column, if known.

class jcmsuite.exceptions.TemplateMappingError(message, *, source=None, line=None, column=None)[source]

Error raised for a problem in a JCMsuite template file.

Parameters:
  • message (str) – Description of the problem.

  • source (str | Path | None, optional) – Template file associated with the diagnostic.

  • line (int | None, optional) – One-based source line, if known.

  • column (int | None, optional) – One-based source column, if known.

class jcmsuite.exceptions.UnsupportedExportError[source]

Error raised when result data cannot use the requested export format.