# \_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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nso-docs.cisco.com/guides/nso-6.6/developer-reference/pyapi/_ncs.error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
