# tf.errors.raise_exception_on_not_ok_status

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/errors_impl.py#L543-L562) |

Context manager to check for C API status.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.errors.raise_exception_on_not_ok_status`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/errors/raise_exception_on_not_ok_status)

<br />

## Methods

### `__enter__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/errors_impl.py#L546-L548)

    __enter__()

### `__exit__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/errors_impl.py#L550-L562)

    __exit__(
        type_arg, value_arg, traceback_arg
    )