Skip to content

@jsvision/files / errorBox

Function: errorBox()

errorBox(host, message): Promise<void>

Defined in: files/src/dialog/error-dialog.ts:60

Show a modal error box with a message and an OK button; resolves once the user closes it (OK or Esc).

Parameters

host

ExecHost

A host that can run a view modally — the createApplication result works directly.

message

string

The error text to show; it is sanitized when drawn.

Returns

Promise<void>

A promise that resolves when the box is dismissed.

Example

ts
import { createApplication } from '@jsvision/ui';
import { resolveCapabilities } from '@jsvision/core';
import { errorBox } from '@jsvision/files';

const caps = resolveCapabilities().profile; // ambient: reads process.env + process.platform
const app = createApplication({ caps });

await errorBox(app, "Invalid file name: 'a/b'");