---
title: Error (v2.3)
description: API reference for qiskit.transpiler.passes.Error in qiskit v2.3
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.3/qiskit.transpiler.passes.Error
---

# Error

*class* `qiskit.transpiler.passes.Error(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/transpiler/passes/utils/error.py#L23-L69)

Bases: [`AnalysisPass`](/docs/api/qiskit/2.3/qiskit.transpiler.AnalysisPass "qiskit.transpiler.basepasses.AnalysisPass")

Error pass to be called when an error happens.

Error pass.

**Parameters**

- **msg** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| Callable\[\[*[*PropertySet*](/docs/api/qiskit/2.3/qiskit.passmanager.PropertySet "qiskit.passmanager.PropertySet")*],* [*str*](https://docs.python.org/3/library/stdtypes.html#str)*]*) – Error message, if not provided a generic error will be used. This can be either a raw string, or a callback function that accepts the current `property_set` and returns the desired message.
- **action** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – the action to perform. Default: ‘raise’. The options are: \* `'raise'`: Raises a `TranspilerError` exception with msg \* `'warn'`: Raises a non-fatal warning with msg \* `'log'`: logs in `logging.getLogger(__name__)`

**Raises**

[**TranspilerError**](/docs/api/qiskit/2.3/transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") – if action is not valid.

## Attributes

### is\_analysis\_pass

Check if the pass is an analysis pass.

If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.

### is\_transformation\_pass

Check if the pass is a transformation pass.

If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).

## Methods

### execute

`execute(passmanager_ir, state, callback=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L72-L118)

Execute optimization task for input Qiskit IR.

**Parameters**

- **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – Qiskit IR to optimize.
- **state** ([*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) – State associated with workflow execution by the pass manager itself.
- **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable) *| None*) – A callback function which is called per execution of optimization task.

**Returns**

Optimized Qiskit IR and state of the workflow.

**Return type**

[tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any), [qiskit.passmanager.compilation\_status.PassManagerState](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")]

### name

`name()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L68-L70)

Name of the pass.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str)

### run

`run(_)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/transpiler/passes/utils/error.py#L48-L69)

Run the Error pass on dag.

### update\_status

`update_status(state, run_state)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L120-L138)

Update workflow status.

**Parameters**

- **state** ([*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) – Pass manager state to update.
- **run\_state** (*RunState*) – Completion status of current task.

**Returns**

Updated pass manager state.

**Return type**

[*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")
