Source code for qiskit_aqt_provider.exceptions

# This code is part of Qiskit.
#
# (C) Copyright Alpine Quantum Technologies GmbH 2023
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

from qiskit.exceptions import QiskitError
from qiskit.providers.exceptions import JobError


[docs] class AQTError(QiskitError): """Base class for errors raised by the AQT provider."""
[docs] class AQTJobError(AQTError, JobError): """Base class for errors raised by AQT cloud jobs."""
[docs] class AQTJobInvalidStateError(AQTJobError): """Error raised when an operation is attempted on a job in an invalid state."""
[docs] class AQTJobFailedError(AQTJobError): """Error raised when a job has failed."""
[docs] class AQTJobPersistenceError(AQTJobError): """Base class for errors raised while persisting or restoring jobs."""
[docs] class AQTJobNotFoundError(AQTJobPersistenceError): """Error raised when a persisted job cannot be found."""
[docs] class AQTJobCorruptError(AQTJobPersistenceError): """Error raised when persisted job data cannot be decoded."""
[docs] class AQTJobIncompatibleError(AQTJobPersistenceError): """Error raised when persisted job data uses an unsupported format."""
[docs] class AQTJobBackendMismatchError(AQTJobPersistenceError): """Error raised when a job is restored on a different backend."""
[docs] class AQTApiError(AQTError): """Errors that occur unexpectedly when querying the server."""
[docs] class AQTCredentialsError(AQTError): """Errors related to authentication and credentials for the AQT API."""
[docs] class AQTValueError(AQTError, ValueError): """Error raised when an invalid value is provided to a function or method."""
[docs] class AQTRequestError(AQTError): """Error raised due to issues with a request."""