Exceptions API

SDK-level exceptions for FastQSim.

All exceptions are raised from HTTP responses or job status codes returned by the FastQubit API. Internal core errors (ParseError, UnsupportedBackend, etc.) are never re-raised here — they appear as plain strings in job.error_message when a job reaches FAILED status.

exception fastqsim.exceptions.APIError[source]

Bases: FastQSimError

General API error (API_001). Raised for unexpected server-side responses that do not map to a more specific SDK exception.

exception fastqsim.exceptions.AuthenticationError[source]

Bases: FastQSimError

Raised when the API token is invalid or expired (HTTP 401).

exception fastqsim.exceptions.FastQSimConnectionError[source]

Bases: FastQSimError

Raised when the SDK cannot reach the FastQubit API endpoint.

exception fastqsim.exceptions.FastQSimError[source]

Bases: Exception

Base exception for all FastQSim SDK errors.

exception fastqsim.exceptions.InvalidDeviceTypeError[source]

Bases: FastQSimError

Raised when an unsupported or invalid device type is specified (VAL_002). Valid device types are: ‘cpu’, ‘gpu’, ‘quantum’.

exception fastqsim.exceptions.JobCouldNotCancelError(job_id, reason='')[source]

Bases: FastQSimError

Raised when a cancellation request is rejected by the server (e.g. the job has already completed or is in a non-cancellable state).

Parameters:
exception fastqsim.exceptions.JobDoesNotContainCountsError[source]

Bases: FastQSimError

Raised when get_counts() is called on a job that was run without measurement shots (e.g. statevector-only simulation).

exception fastqsim.exceptions.JobFailedError(job_id, reason='')[source]

Bases: FastQSimError

Raised when a job reaches FAILED status.

Parameters:
job_id

The ID of the failed job.

reason

The worker error message, if available.

exception fastqsim.exceptions.JobNotCompleteError(job_id, current_status='')[source]

Bases: FastQSimError

Raised when a result-retrieval method is called on a job that has not yet reached a terminal state (e.g. still RUNNING or QUEUED).

Parameters:
  • job_id (str)

  • current_status (str)

exception fastqsim.exceptions.JobNotFoundError(job_id)[source]

Bases: FastQSimError

Raised when a job_id does not exist on the server (HTTP 404).

Parameters:

job_id (str)

exception fastqsim.exceptions.JobStatevectorTooLargeError[source]

Bases: FastQSimError

Raised when the statevector is too large to retrieve over the network (number of qubits exceeds the server-side retrieval limit).

exception fastqsim.exceptions.JobTimeoutError(job_id, timeout)[source]

Bases: FastQSimError

Raised when polling exceeds the configured timeout before the job reaches a terminal state.

Parameters:
job_id

The ID of the job that timed out.

timeout

The timeout in seconds that was exceeded.

exception fastqsim.exceptions.QuotaExceededError[source]

Bases: FastQSimError

Raised when the integrator’s concurrency or monthly quota is exhausted (HTTP 402).

exception fastqsim.exceptions.UnauthorizedAccessError[source]

Bases: FastQSimError

Raised when the authenticated user lacks permission for a resource (HTTP 403).

exception fastqsim.exceptions.ValidationError[source]

Bases: FastQSimError

Raised when the submitted circuit or parameters fail server-side validation (HTTP 422).