# `CalDAVEx.Error`
[🔗](https://github.com/ciroque/caldav_ex/blob/v0.1.3/lib/caldav_ex/error.ex#L1)

Error types and utilities for CalDAV operations.

All CalDAVEx functions return errors as `{:error, %CalDAVEx.Error{}}`.

# `t`

```elixir
@type t() :: %CalDAVEx.Error{
  details: String.t() | nil,
  message: String.t() | nil,
  type: atom()
}
```

Error struct.

## Fields

- `type` - The error type (`:transport`, `:http`, `:xml`, `:protocol`, `:not_found`, `:unauthorized`, `:conflict`)
- `message` - Human-readable error message
- `details` - Additional error details (optional)

# `conflict`

Creates a conflict error (HTTP 409)

# `http`

Creates an HTTP error with status code and response body

# `not_found`

Creates a not found error (HTTP 404)

# `protocol`

Creates a CalDAV protocol error

# `to_string`

Converts an error to a human-readable string.

## Examples

    error = CalDAVEx.Error.http(404, "Not found")
    CalDAVEx.Error.to_string(error)
    # => "[caldav_ex] HTTP error: HTTP 404 - Not found"

# `transport`

Creates a transport error (network/connection issues)

# `unauthorized`

Creates an unauthorized error (HTTP 401)

# `xml`

Creates an XML parsing error

---

*Consult [api-reference.md](api-reference.md) for complete listing*
