More descriptive error message for bad conversion function input.
Before:
from qiskit_braket_provider.providers.adapter import convert_qiskit_to_braket_circuit
convert_qiskit_to_braket_circuit("abc")
# AttributeError: 'Circuit' object has no attribute 'data'
from unittest.mock import Mock
bad_input = Mock()
bad_input.data = []
convert_qiskit_to_braket_circuit(fake)
# TypeError: '>' not supported between instances of 'Mock' and 'float'
etc.
Now:
convert_qiskit_to_braket_circuit(input)
# TypeError: 'Expected a qiskit.QuantumCircuit, got <type(input)> instead'
Hello @ryanhill1 , I'm considering changing the API in another PR, and it looks going in the same direction. I cannot guarantee to merge it fast so I'd be fine to merge this first.
Summary
More descriptive error message for bad conversion function input.
Before:
etc.
Now: