# \_ncs.error Module

This module defines new NCS Python API exception classes.

Instead of checking for CONFD\_ERR or CONFD\_EOF return codes all Python module APIs raises an exception instead.

## Classes

### *class* **EOF**

This exception will be thrown from an API function that, from a C perspective, would result in a CONFD\_EOF return value.

Members:

<details>

<summary>add_note(...)</summary>

Method:

Exception.add\_note(note) -- add a note to the exception

</details>

<details>

<summary>args</summary>

</details>

<details>

<summary>with_traceback(...)</summary>

Method:

Exception.with\_traceback(tb) -- set self.**traceback** to tb and return self.

</details>

### *class* **Error**

This exception will be thrown from an API function that, from a C perspective, would result in a CONFD\_ERR return value.

Available attributes:

* confd\_errno -- the underlying error number
* confd\_strerror -- string representation of the confd\_errno
* confd\_lasterr -- string with additional textual information
* strerror -- os error string (available if confd\_errno is CONFD\_ERR\_OS)

Members:

<details>

<summary>add_note(...)</summary>

Method:

Exception.add\_note(note) -- add a note to the exception

</details>

<details>

<summary>args</summary>

</details>

<details>

<summary>with_traceback(...)</summary>

Method:

Exception.with\_traceback(tb) -- set self.**traceback** to tb and return self.

</details>
