# Enum `kurogane::RuntimeError`

```rust
#[non_exhaustive]
pub enum RuntimeError {
    InvalidAssetRoot(PathBuf),
    InvalidFrontendUrl { url: String, source: Box<dyn Error + Send + Sync> },
    AssetRootMissing(PathBuf),
    EntrypointMissing(PathBuf),
    AssetRootUnavailable { path: PathBuf, source: Error },
    CefInitializeFailed { code: i32 },
    CefNotInstalled { expected: Option<PathBuf> },
    CefPathMissing(PathBuf),
    CefVersionMismatch { path: PathBuf, location: CefLocation, found: String, expected: String },
    InvalidCefRuntime { path: PathBuf, location: CefLocation, source: Box<dyn Error + Send + Sync> },
    ExecutableUnavailable(Error),
    BundleHelperUnavailable { source: Box<dyn Error + Send + Sync> },
    CacheUnavailable { path: PathBuf, source: Error },
    BrowserCreationFailed,
    WindowCreationFailed,
    InvalidWindowOptions(&'static str),
    WindowNameTaken { name: String, window: WindowId },
    ShuttingDown,
    UnsupportedParentWindow,
    SandboxUnsupported { reason: String },
    SandboxUnavailable { reason: String },
    InvalidConfiguration(Vec<ConfigError>),
    InvalidFilesystem(FsConfigError),
}
```

Failure to start the application or to open a window or a browser.

## Variants

### `InvalidAssetRoot`

```rust
InvalidAssetRoot(PathBuf)
```

The frontend path given to [`App::new`](https://kurogane-rs.org/docs/api/app/app.md#method.new) exists but is
not a directory.

[crate::App::new]: https://kurogane-rs.org/docs/api/app/app.md#method.new

### `InvalidFrontendUrl`

```rust
InvalidFrontendUrl { url: String, source: Box<dyn Error + Send + Sync> }
```

The frontend URL could not be parsed; `source` says why.

### `AssetRootMissing`

```rust
AssetRootMissing(PathBuf)
```

The frontend directory given to [`App::new`](https://kurogane-rs.org/docs/api/app/app.md#method.new) does not
exist.

[crate::App::new]: https://kurogane-rs.org/docs/api/app/app.md#method.new

### `EntrypointMissing`

```rust
EntrypointMissing(PathBuf)
```

The frontend directory exists but has no `index.html` to serve; none,
a directory by that name, or a link out of the directory.

### `AssetRootUnavailable`

```rust
AssetRootUnavailable { path: PathBuf, source: Error }
```

The frontend directory at `path` cannot be read; `source` says why.

### `CefInitializeFailed`

```rust
CefInitializeFailed { code: i32 }
```

Chromium refused to start after Kurogane found its runtime; its log
names the cause.

### `CefNotInstalled`

```rust
CefNotInstalled { expected: Option<PathBuf> }
```

No Chromium runtime beside the executable, no `CEF_PATH` and nothing
installed at `expected`, which is `None` for a user without a local
data directory.

### `CefPathMissing`

```rust
CefPathMissing(PathBuf)
```

`CEF_PATH` names a directory that does not exist; no other runtime
runs in its place.

### `CefVersionMismatch`

```rust
CefVersionMismatch { path: PathBuf, location: CefLocation, found: String, expected: String }
```

The Chromium runtime at `path`, from `location`, is another CEF
build, commit `found`, than the one the application was built
against, `expected`.

### `InvalidCefRuntime`

```rust
InvalidCefRuntime { path: PathBuf, location: CefLocation, source: Box<dyn Error + Send + Sync> }
```

The Chromium runtime at `path`, from `location`, cannot be used;
`source` says why.

### `ExecutableUnavailable`

```rust
ExecutableUnavailable(Error)
```

The path to the running executable could not be determined.

### `BundleHelperUnavailable`

```rust
BundleHelperUnavailable { source: Box<dyn Error + Send + Sync> }
```

The macOS application bundle the executable belongs to has no single
helper app to start Chromium's processes from; `source` says what it
holds.

### `CacheUnavailable`

```rust
CacheUnavailable { path: PathBuf, source: Error }
```

The profile directory at `path` cannot be created; `source` says why.

### `BrowserCreationFailed`

```rust
BrowserCreationFailed
```

CEF created no browser.

### `WindowCreationFailed`

```rust
WindowCreationFailed
```

CEF created no window.

### `InvalidWindowOptions`

```rust
InvalidWindowOptions(&'static str)
```

[`AppInstance::create_window`](https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_window) was
given options no window can have, named here.

[crate::AppInstance::create_window]: https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_window

### `WindowNameTaken`

```rust
WindowNameTaken { name: String, window: WindowId }
```

A window was asked for under `name`
([`WindowOptions::name`](https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.name)), which the
open window `window` holds. The name is free once that window's
close is reported ([`App::on_window_closing`](https://kurogane-rs.org/docs/api/app/app.md#method.on_window_closing)).

[crate::App::on_window_closing]: https://kurogane-rs.org/docs/api/app/app.md#method.on_window_closing
[crate::WindowOptions::name]: https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.name

### `ShuttingDown`

```rust
ShuttingDown
```

The application is ending and no browser may open after
[`AppHandle::shutdown`](https://kurogane-rs.org/docs/api/app/apphandle.md#method.shutdown), a forced
[`AppHandle::close_all_browsers`](https://kurogane-rs.org/docs/api/app/apphandle.md#method.close_all_browsers), or
[`AppInstance::shutdown`](https://kurogane-rs.org/docs/api/app/appinstance.md#method.shutdown) has begun.

[crate::AppHandle::shutdown]: https://kurogane-rs.org/docs/api/app/apphandle.md#method.shutdown
[crate::AppHandle::close_all_browsers]: https://kurogane-rs.org/docs/api/app/apphandle.md#method.close_all_browsers
[crate::AppInstance::shutdown]: https://kurogane-rs.org/docs/api/app/appinstance.md#method.shutdown

### `UnsupportedParentWindow`

```rust
UnsupportedParentWindow
```

The window given to
[`AppInstance::create_child_browser`](https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_child_browser)
cannot parent a browser. CEF embeds only in a Win32 window, an AppKit
view or an X11 window. A Wayland surface is not one of them.

[crate::AppInstance::create_child_browser]: https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_child_browser

### `SandboxUnsupported`

```rust
SandboxUnsupported { reason: String }
```

The requested sandbox cannot be enforced on this platform or layout.

### `SandboxUnavailable`

```rust
SandboxUnavailable { reason: String }
```

The requested sandbox is supported but not usable on this machine.

### `InvalidConfiguration`

```rust
InvalidConfiguration(Vec<ConfigError>)
```

The [`App`](https://kurogane-rs.org/docs/api/app/app.md) builder was misconfigured. Every problem is
listed; nothing was started.

[crate::App]: https://kurogane-rs.org/docs/api/app/app.md

### `InvalidFilesystem`

```rust
InvalidFilesystem(FsConfigError)
```

The filesystem configuration passed to
[`App::filesystem`](https://kurogane-rs.org/docs/api/app/app.md#method.filesystem) was rejected; nothing was
started.

[crate::App::filesystem]: https://kurogane-rs.org/docs/api/app/app.md#method.filesystem

## Trait implementations

- `impl Debug for RuntimeError`
- `impl Display for RuntimeError`
- `impl Error for RuntimeError`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/error.rs#L9
