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:
FastQSimErrorGeneral 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:
FastQSimErrorRaised when the API token is invalid or expired (HTTP 401).
- exception fastqsim.exceptions.FastQSimConnectionError[source]¶
Bases:
FastQSimErrorRaised when the SDK cannot reach the FastQubit API endpoint.
- exception fastqsim.exceptions.FastQSimError[source]¶
Bases:
ExceptionBase exception for all FastQSim SDK errors.
- exception fastqsim.exceptions.InvalidDeviceTypeError[source]¶
Bases:
FastQSimErrorRaised 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:
FastQSimErrorRaised when a cancellation request is rejected by the server (e.g. the job has already completed or is in a non-cancellable state).
- exception fastqsim.exceptions.JobDoesNotContainCountsError[source]¶
Bases:
FastQSimErrorRaised 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:
FastQSimErrorRaised when a job reaches FAILED status.
- 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:
FastQSimErrorRaised when a result-retrieval method is called on a job that has not yet reached a terminal state (e.g. still RUNNING or QUEUED).
- exception fastqsim.exceptions.JobNotFoundError(job_id)[source]¶
Bases:
FastQSimErrorRaised when a job_id does not exist on the server (HTTP 404).
- Parameters:
job_id (str)
- exception fastqsim.exceptions.JobStatevectorTooLargeError[source]¶
Bases:
FastQSimErrorRaised 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:
FastQSimErrorRaised when polling exceeds the configured timeout before the job reaches a terminal state.
- job_id¶
The ID of the job that timed out.
- timeout¶
The timeout in seconds that was exceeded.
- exception fastqsim.exceptions.QuotaExceededError[source]¶
Bases:
FastQSimErrorRaised when the integrator’s concurrency or monthly quota is exhausted (HTTP 402).
- exception fastqsim.exceptions.UnauthorizedAccessError[source]¶
Bases:
FastQSimErrorRaised when the authenticated user lacks permission for a resource (HTTP 403).
- exception fastqsim.exceptions.ValidationError[source]¶
Bases:
FastQSimErrorRaised when the submitted circuit or parameters fail server-side validation (HTTP 422).