# Enum `kurogane::ErrorCode`

```rust
#[non_exhaustive]
pub enum ErrorCode {
    Handler,
    Panic,
    Buffer,
    Dropped,
    Acl,
    Capability,
    PathDenied,
    PathInvalid,
    TooLarge,
    Left,
    App(NonZeroU16),
}
```

Classifies an [`IpcError`] by the numeric code exposed to the renderer.
Runtime errors use the fixed codes `0` through `-9`; applications may use
positive codes through [`ErrorCode::App`].

[`IpcError`]: https://kurogane-rs.org/docs/api/ipc/ipcerror.md
[`ErrorCode::App`]: https://kurogane-rs.org/docs/api/ipc/errorcode.md#variant.App

## Variants

### `Handler`

```rust
Handler
```

A handler reported a failure (`0`, the default).

### `Panic`

```rust
Panic
```

The handler panicked (`-1`).

### `Buffer`

```rust
Buffer
```

The request or response could not be decoded or encoded (`-2`).

### `Dropped`

```rust
Dropped
```

The handler dropped its responder without resolving (`-3`).

### `Acl`

```rust
Acl
```

The ACL refused the calling origin (`-4`).

### `Capability`

```rust
Capability
```

No capability grant of the origin covers the operation (`-5`).

### `PathDenied`

```rust
PathDenied
```

The path is outside the granted roots, denied, or a link (`-6`).

### `PathInvalid`

```rust
PathInvalid
```

The path is malformed (`-7`).

### `TooLarge`

```rust
TooLarge
```

The file or message exceeds its transfer limit (`-8`).

### `Left`

```rust
Left
```

The page left with the request open and came back from the
back-forward cache (`-9`).

### `App`

```rust
App(NonZeroU16)
```

An application-defined code, sent as is.

## Methods

### `wire`

```rust
pub fn wire(self) -> i32
```

The numeric code the renderer receives.

## Trait implementations

- `impl Clone for ErrorCode`
- `impl Copy for ErrorCode`
- `impl Debug for ErrorCode`
- `impl Eq for ErrorCode`
- `impl Hash for ErrorCode`
- `impl PartialEq for ErrorCode`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/ipc/browser_state.rs#L21
