API Reference
errorPayload()
R-data-payload / D78: host-language failures that collide with ctx.terminal shorthand become diagnostics.
Import
import { errorPayload } from "@graphrefly/ts/core";
Signature
function errorPayload(
reason: unknown,
fallback = "error without a valid payload",
): unknown
Parameters
| Parameter | Type | Description |
|---|---|---|
reason | unknown | reason value used by the helper. |
fallback | unknown | fallback value used by the helper. |
Returns
The error payload result.
Example
import { errorPayload } from "@graphrefly/ts/core";
Source
packages/ts/src/protocol/messages.ts