> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# veryfront/errors

> Structured error system with slug-based registry, RFC 9457 HTTP problem details, error boundaries for HTTP and CLI, and user-friendly formatting.

## Import

```ts theme={null}
import {
  attachErrorToActiveSpan,
  attachErrorToSpan,
  cliErrorBoundary,
  cliErrorBoundarySync,
  createError,
  createErrorHandler,
} from "veryfront/errors";
```

## Examples

### Define and create a structured framework error

```ts theme={null}
import { defineError } from "veryfront/errors";

const INVALID_WIDGET = defineError({
  slug: "invalid-widget",
  category: "GENERAL",
  title: "Invalid widget",
  status: 400,
});
throw INVALID_WIDGET.create({ detail: "The widget id is malformed." });
```

## Exports

### Components

| Name                              | Description                                                                                                      | Source                                                                                                       |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `AGENT_ERROR`                     |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L2)        |
| `AGENT_INTENT_ERROR`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L26)       |
| `AGENT_NOT_FOUND`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L10)       |
| `AGENT_TIMEOUT`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L18)       |
| `API_CLIENT_ERROR`                | API client request/response errors (replaces VeryfrontAPIError)                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L83)      |
| `API_ERROR`                       |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L42)     |
| `API_ROUTE_ERROR`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L42)       |
| `ASSET_OPTIMIZATION_ERROR`        |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L34)       |
| `AUTHENTICATION_REQUIRED`         |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L10)     |
| `BRANCH_NOT_FOUND`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L90)      |
| `BUILD_ERROR_CATALOG`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/build-errors.ts#L3)        |
| `BUILD_FAILED`                    |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L2)        |
| `BUNDLE_ERROR`                    |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L10)       |
| `CACHE_ERROR`                     |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L18)      |
| `CACHE_INVARIANT_VIOLATION`       | Cache path invariant violations (replaces CacheInvariantError)                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L101)     |
| `CACHE_PATH_MISMATCH`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L66)      |
| `CIRCUIT_BREAKER_OPEN`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L58)      |
| `CIRCULAR_DEPENDENCY`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L18)      |
| `CLIENT_BOUNDARY_VIOLATION`       |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L2)     |
| `CLIENT_ONLY_IN_SERVER`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L18)    |
| `COMPILATION_ERROR`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L58)       |
| `COMPONENT_ERROR`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L18)     |
| `CONFIG_ERROR_CATALOG`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/config-errors.ts#L3)       |
| `CONFIG_INVALID`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L11)      |
| `CONFIG_NOT_FOUND`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L2)       |
| `CONFIG_PARSE_ERROR`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L19)      |
| `CONFIG_TYPE_ERROR`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L36)      |
| `CONFIG_VALIDATION_ERROR`         | Schema-level config validation (e.g. Zod schema mismatch at runtime)                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L28)      |
| `CONFIG_VALIDATION_FAILED`        | Config file validation failures (replaces ConfigValidationError)                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L61)      |
| `CORS_CONFIG_INVALID`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L52)      |
| `COST_LIMIT_EXCEEDED`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L42)       |
| `DEPENDENCY_MISSING`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L34)      |
| `DEPLOYMENT_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L2)       |
| `DEPLOYMENT_ERROR_CATALOG`        |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/deployment-errors.ts#L3)   |
| `DEPLOYMENT_VERIFICATION_TIMEOUT` |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L58)      |
| `DEV_ERROR_CATALOG`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/dev-errors.ts#L3)          |
| `DEV_SERVER_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/dev.ts#L10)         |
| `DYNAMIC_ROUTE_ERROR`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L26)       |
| `ENV_VAR_MISSING`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L18)      |
| `ENVIRONMENT_NOT_FOUND`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L34)      |
| `ERROR_CATALOG`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/index.ts#L30)              |
| `ERROR_OVERLAY_ERROR`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/dev.ts#L26)         |
| `ERROR_REGISTRY`                  | Central registry mapping every error slug to its definition. Assembled from the per-category registry fragments. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry.ts#L38)             |
| `ERROR_SOLUTIONS`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/user-friendly/error-catalog.ts#L4) |
| `FALLBACK_EXHAUSTED`              | Both primary and fallback operations failed (replaces FallbackExecutionError)                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L119)     |
| `FAST_REFRESH_ERROR`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/dev.ts#L18)         |
| `FILE_NOT_FOUND`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L26)     |
| `FILE_WATCH_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L26)      |
| `GENERAL_ERROR_CATALOG`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/general-errors.ts#L3)      |
| `HMR_ERROR`                       |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/dev.ts#L2)          |
| `HYDRATION_MISMATCH`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L2)      |
| `IMPORT_MAP_INVALID`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L44)      |
| `IMPORT_RESOLUTION_ERROR`         |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L10)      |
| `INITIALIZATION_ERROR`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L59)     |
| `INPUT_VALIDATION_FAILED`         | HTTP request input validation failures (replaces ValidationError)                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L85)     |
| `INVALID_ARGUMENT`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L42)     |
| `INVALID_IMPORT`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L26)      |
| `INVALID_ROUTE_FILE`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L10)       |
| `INVALID_USE_CLIENT`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L26)    |
| `INVALID_USE_SERVER`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L34)    |
| `LAYOUT_NOT_FOUND`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L26)     |
| `MDX_COMPILE_ERROR`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L26)       |
| `MIDDLEWARE_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L50)     |
| `MODULE_ERROR_CATALOG`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/module-errors.ts#L3)       |
| `MODULE_NOT_FOUND`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L2)       |
| `NETWORK_ERROR`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L74)      |
| `NOT_SUPPORTED`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L67)     |
| `ORCHESTRATION_ERROR`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L34)       |
| `PAGE_NOT_FOUND`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L34)     |
| `PERMISSION_DENIED`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L18)     |
| `PLATFORM_ERROR`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L10)      |
| `PORT_IN_USE`                     |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L2)       |
| `PREVIEW_HOSTNAME_TOO_LONG`       |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L82)      |
| `PROBLEM_JSON_CONTENT_TYPE`       | Content-Type header for RFC 9457 responses                                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L31)                 |
| `PRODUCTION_BUILD_REQUIRED`       |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L26)      |
| `PROJECT_SOURCE_EMPTY`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L93)     |
| `PUSH_RECEIPT_MISSING`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L66)      |
| `RELEASE_BUILD_TIMEOUT`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L50)      |
| `RELEASE_MISSING_VERSION`         |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L42)      |
| `RELEASE_NOT_FOUND`               | Production domain resolved but no active release found                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L110)     |
| `RENDER_ERROR`                    |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L10)     |
| `REQUEST_ERROR`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L34)      |
| `RESOURCE_NOT_FOUND`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L34)     |
| `ROUTE_CONFLICT`                  |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L2)        |
| `ROUTE_ERROR_CATALOG`             |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/route-errors.ts#L3)        |
| `ROUTE_HANDLER_INVALID`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L18)       |
| `ROUTE_PARAMS_ERROR`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/route.ts#L34)       |
| `RSC_ERROR_CATALOG`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/rsc-errors.ts#L3)          |
| `RSC_PAYLOAD_ERROR`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L42)    |
| `RUNTIME_ERROR_CATALOG`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/runtime-errors.ts#L3)      |
| `SCHEDULE_CONFIG_INVALID`         | Schedule definition validation failures (required fields, cron, concurrencyPolicy, target)                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L79)      |
| `SECURITY_VIOLATION`              | Path traversal / secure-fs violations (replaces SecurityError)                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L76)     |
| `SEMAPHORE_TIMEOUT`               |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L50)      |
| `SERVER_ERROR_CATALOG`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/server-errors.ts#L3)       |
| `SERVER_ONLY_IN_CLIENT`           |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/boundary.ts#L10)    |
| `SERVER_START_ERROR`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L10)      |
| `SERVICE_OVERLOADED`              |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L42)      |
| `SOURCE_DIGEST_MISMATCH`          |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/deploy.ts#L74)      |
| `SOURCE_MAP_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/dev.ts#L34)         |
| `SOURCEMAP_ERROR`                 |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L50)       |
| `SSG_GENERATION_ERROR`            |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L42)       |
| `TIMEOUT_ERROR`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L51)     |
| `TOKEN_STORAGE_ERROR`             | Token storage adapter failures (replaces TokenStorageError)                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/server.ts#L92)      |
| `TOOL_ID_CONFLICT`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/agent.ts#L50)       |
| `TRIGGER_CONFIG_INVALID`          | Trigger ID format and input serialization validation failures                                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L89)      |
| `TRIGGER_EXECUTION_FAILED`        | Trigger target task or workflow failed during local run                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L68)     |
| `TRIGGER_NOT_SUPPORTED`           | Trigger target type is not supported in the current runtime context                                              | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L77)     |
| `TRIGGER_TARGET_NOT_FOUND`        | Trigger target (task or workflow) not found during local run                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/runtime.ts#L59)     |
| `TYPESCRIPT_ERROR`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/build.ts#L18)       |
| `UNKNOWN_ERROR`                   |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L2)      |
| `VERSION_MISMATCH`                |                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L42)      |
| `WEBHOOK_CONFIG_INVALID`          | Webhook definition validation failures (required fields, target, eventFilter)                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/config.ts#L70)      |

### Functions

| Name                                | Description                                                                                                         | Source                                                                                                           |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `attachErrorToActiveSpan`           | Attach error to the currently active span (if any)                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/tracing.ts#L86)                        |
| `attachErrorToSpan`                 | Attach error metadata to an OpenTelemetry span                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/tracing.ts#L38)                        |
| `cliErrorBoundary`                  | CLI error boundary - wraps a handler function and catches errors                                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/cli-error-boundary.ts#L182) |
| `cliErrorBoundarySync`              | Synchronous version of CLI error boundary                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/cli-error-boundary.ts#L208) |
| `createError`                       |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L104)               |
| `createErrorHandler`                | Express/Hono-style error handler middleware factory                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L125)                    |
| `createErrorResponse`               | Create an RFC 9457 compliant error Response                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L45)                     |
| `createErrorResponseFromDefinition` | Create an RFC 9457 error Response from a registered error definition                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L54)                     |
| `createErrorScope`                  | Create a scoped error context helper for multiple related operations                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L178)                 |
| `createErrorSolution`               |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/factory.ts#L10)                |
| `createProblemResponse`             | Create an RFC 9457 error Response from raw parameters                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L69)                     |
| `createSimpleError`                 |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/factory.ts#L28)                |
| `defineError`                       | Define an error in the registry                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L94)                          |
| `ensureError`                       | Ensure a value is an Error while preserving the established identity contract for ordinary Error instances.         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L836)               |
| `errorToResponse`                   | Convert any error to an RFC 9457 Response                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L105)                    |
| `errorToRFC9457Response`            | Convert any error to an RFC 9457 Response with environment-aware filtering                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/http-error-boundary.ts#L97) |
| `formatCLIError`                    | Format any error for CLI output                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/cli-error-boundary.ts#L162) |
| `formatErrorLog`                    | Log format for errors (matches the plan's log format spec)                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L141)                    |
| `formatUserError`                   | Format error with plain text (existing behavior)                                                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/user-friendly/error-formatter.ts#L84)  |
| `fromError`                         | Decode legacy Veryfront error data attached by `toError()`.                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/legacy-error-codec.ts#L16)             |
| `getAllSlugs`                       | Get all registered slugs                                                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry.ts#L71)                 |
| `getErrorBySlug`                    | Get an error definition by slug                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry.ts#L57)                 |
| `getErrorMessage`                   | Extract error message from any error type                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L677)               |
| `getErrorsByCategory`               | Get all errors in a category                                                                                        | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry.ts#L64)                 |
| `getErrorSolution`                  |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/index.ts#L43)                  |
| `handleErrorWithFallback`           |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-handlers.ts#L40)                 |
| `handleErrorWithFallbackSync`       |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-handlers.ts#L53)                 |
| `httpErrorBoundary`                 | Wrap a handler with error boundary that catches all errors and converts them to RFC 9457 Problem Details responses. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/http-error-boundary.ts#L54) |
| `identifyError`                     |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/user-friendly/error-identifier.ts#L25) |
| `isVeryfrontError`                  | Check if an error is a VeryfrontError with slug-based identity                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/http-error.ts#L95)                     |
| `logError`                          | Log a VeryfrontError with structured formatting                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/logging.ts#L95)                        |
| `logErrorWithMessage`               | Log an error with a custom message prefix                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/logging.ts#L147)                       |
| `retryWithBackoff`                  |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-handlers.ts#L148)                |
| `safeFileRead`                      | Safe file read with logging                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L149)                 |
| `safeFileStat`                      | Safe file stat with logging                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L136)                 |
| `safeReadDir`                       | Safe directory read with logging                                                                                    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L162)                 |
| `searchErrors`                      |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/index.ts#L47)                  |
| `toError`                           | Convert a VeryfrontErrorData (plain object) to a throwable Error instance.                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L621)               |
| `toError`                           |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L622)               |
| `toError`                           |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L626)               |
| `withErrorContext`                  | Execute async operation with error logging and fallback                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L108)                 |
| `withErrorContextSync`              | Execute sync operation with error logging and fallback                                                              | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L122)                 |
| `wrapErrorHandler`                  |                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/user-friendly/error-wrapper.ts#L25)    |
| `wrapHandlerWithErrorBoundary`      | Wrap a complete Handler object with error boundary                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/http-error-boundary.ts#L84) |
| `wrapUnknownError`                  | Return a detached VeryfrontError, preserving safe identity fields from valid VeryfrontError inputs                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/wrap-unknown.ts#L50)        |
| `wrapWithContext`                   | Wrap an error with additional context                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/middleware/wrap-unknown.ts#L100)       |

### Classes

| Name             | Description                                          | Source                                                                                   |
| ---------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `VeryfrontError` | Veryfront Error class with slug-based error identity | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L157) |

### Types

| Name                        | Description                                                                                                                                                      | Source                                                                                                       |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `ConfigContext`             |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L61)            |
| `ErrorCatalog`              |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/types.ts#L13)              |
| `ErrorCategory`             | Error categories for domain-based grouping and handling                                                                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L10)                      |
| `ErrorContext`              |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L15)              |
| `ErrorCreateOptions`        | Options for creating an error instance                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L53)                      |
| `ErrorDefinition`           | Error definition for the registry                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L40)                      |
| `ErrorHandlingOptions`      |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L24)              |
| `ErrorLogEntry`             |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/logging.ts#L23)                    |
| `ErrorSlug`                 |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry.ts#L52)             |
| `ErrorSolution`             |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/types.ts#L2)               |
| `LogLevel`                  |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-context.ts#L22)              |
| `PartialErrorCatalog`       |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/catalog/types.ts#L14)              |
| `RegisteredError`           | Registered error with factory method                                                                                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L67)                      |
| `RetryWithBackoffOptions`   | Options for `retryWithBackoff`. Every `attempt` value passed to `fn` and the hooks below is 0-based (first try = 0), including `wrapFinalError`'s `lastAttempt`. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-handlers.ts#L71)             |
| `RFC9457Response`           | RFC 9457 Problem Details response shape                                                                                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L26)                      |
| `UserFriendlyErrorSolution` |                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/user-friendly/error-catalog.ts#L2) |
| `VeryfrontErrorData`        | Discriminated union for serializable error data.                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/veryfront-error.ts#L92)            |
| `VeryfrontErrorOptions`     | Options for VeryfrontError constructor                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/types.ts#L128)                     |

## Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

### `veryfront/errors/general`

```ts theme={null}
import { AUTHENTICATION_REQUIRED, FILE_NOT_FOUND, GENERAL_REGISTRY } from "veryfront/errors/general";
```

#### Components

| Name                      | Description                                                       | Source                                                                                                    |
| ------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `AUTHENTICATION_REQUIRED` |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L10)  |
| `FILE_NOT_FOUND`          |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L26)  |
| `GENERAL_REGISTRY`        | Registry fragment for GENERAL errors (slug → definition).         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L110) |
| `INITIALIZATION_ERROR`    |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L59)  |
| `INPUT_VALIDATION_FAILED` | HTTP request input validation failures (replaces ValidationError) | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L85)  |
| `INVALID_ARGUMENT`        |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L42)  |
| `NOT_SUPPORTED`           |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L67)  |
| `PERMISSION_DENIED`       |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L18)  |
| `PROJECT_SOURCE_EMPTY`    |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L93)  |
| `RESOURCE_NOT_FOUND`      |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L34)  |
| `SECURITY_VIOLATION`      | Path traversal / secure-fs violations (replaces SecurityError)    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L76)  |
| `TIMEOUT_ERROR`           |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L51)  |
| `UNKNOWN_ERROR`           |                                                                   | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/general.ts#L2)   |

### `veryfront/errors/module`

```ts theme={null}
import { CIRCULAR_DEPENDENCY, DEPENDENCY_MISSING, IMPORT_RESOLUTION_ERROR } from "veryfront/errors/module";
```

#### Components

| Name                      | Description                                              | Source                                                                                                  |
| ------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `CIRCULAR_DEPENDENCY`     |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L18) |
| `DEPENDENCY_MISSING`      |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L34) |
| `IMPORT_RESOLUTION_ERROR` |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L10) |
| `INVALID_IMPORT`          |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L26) |
| `MODULE_NOT_FOUND`        |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L2)  |
| `MODULE_REGISTRY`         | Registry fragment for MODULE errors (slug → definition). | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L51) |
| `VERSION_MISMATCH`        |                                                          | [source](https://github.com/veryfront/veryfront-code/blob/main/src/errors/error-registry/module.ts#L42) |
