> For the complete documentation index, see [llms.txt](https://cbfs.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cbfs.ortusbooks.com/reference/reference/errors.md).

# Errors

| Exception                         | When it is raised                                                |
| --------------------------------- | ---------------------------------------------------------------- |
| `cbfs.InvalidDiskException`       | A disk name is requested before it is registered.                |
| `cbfs.IncorrectDslException`      | A WireBox DSL definition is not supported.                       |
| `cbfs.FileNotFoundException`      | A required file is missing.                                      |
| `cbfs.DirectoryNotFoundException` | A required directory is missing.                                 |
| `cbfs.DirectoryExistsException`   | A directory exists and `ignoreExists=false`.                     |
| `cbfs.FileOverrideException`      | An operation would replace a file while overwrite is disabled.   |
| `cbfs.PathNotFoundException`      | A required parent path is missing.                               |
| `UnsupportedOperationException`   | A provider cannot implement an operation such as symbolic links. |

Most mutating methods are tolerant where practical. `delete()` can return a false result for a missing path unless `throwOnMissing=true`; `append()` and `prepend()` create the file unless `throwOnMissing=true`. Check the method reference before relying on a default.

```javascript
try {
    disk.delete( "reports/old.csv", true );
} catch ( any error ) {
    if ( error.type == "cbfs.FileNotFoundException" ) {
        // Decide whether a missing file is acceptable.
    } else {
        rethrow;
    }
}
```

S3 operations can also raise errors from the underlying `s3sdk` client or remote service. Preserve useful error detail in logs without exposing credentials or signed URLs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cbfs.ortusbooks.com/reference/reference/errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
