Exceptions#

Exceptions for the IonQ Provider.

exception qiskit_ionq.exceptions.IonQAPIError(message, status_code, headers, body, error_type)[source]#

Base exception for fatal API errors.

status_code#

An HTTP response status code.

Type:

int

error_type#

An error type string from the IonQ REST API.

Type:

str

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

classmethod from_response(response)[source]#

Raise an instance of the exception class from an API response object.

Parameters:

response (Response) – An IonQ REST API response.

Returns:

instance of cls with error detail from response.

Return type:

IonQAPIError

classmethod raise_for_status(response)[source]#

Raise an instance of the exception class from an API response object if needed. :param response: An IonQ REST API response. :type response: Response

Raises:
  • IonQAPIError – instance of cls with error detail from response.

  • IonQRetriableError – instance of cls with error detail from response.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQBackendError(*message)[source]#

Errors generated from improper usage of IonQBackend objects.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQClientError(*message)[source]#

Errors that arise from unexpected behavior while using IonQClient.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQCredentialsError(*message)[source]#

Errors generated from bad credentials or config

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQError(*message)[source]#

Base class for errors raised by an IonQProvider.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQGateError(gate_name, gateset)[source]#

Errors generated from invalid gate defs

gate_name#

The name of the gate which caused this error.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQJobError(*message)[source]#

Errors generated from improper usage of IonQJob objects.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQJobTimeoutError(*message)[source]#

Errors generated from job timeouts

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQMetadataStringError(string_length)[source]#

Errors generated from metadata strings being too long

string_length#

The length of the metadata string that’s too long.

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception qiskit_ionq.exceptions.IonQMidCircuitMeasurementError(qubit_index, gate_name)[source]#

Errors generated from attempting mid-circuit measurement, which is not supported. Measurement must come after all instructions.

qubit_index#

The qubit index to be measured mid-circuit

Set the error message.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.