GraphReFlyTS

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

ParameterTypeDescription
reasonunknownreason value used by the helper.
fallbackunknownfallback value used by the helper.

Returns

The error payload result.

Example

import { errorPayload } from "@graphrefly/ts/core";

Source

packages/ts/src/protocol/messages.ts