Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

653 B
Raw Blame
/**
 * The two error classes the plugin RPC boundary maps onto wire error codes.
 *
 * handle() in rpc-host.ts translates them: BadParams -> BAD_PARAMS,
 * ForbiddenResource -> RESOURCE_FORBIDDEN, anything else -> HOST_ERROR. Lifted out
 * of rpc-host.ts so decorated *.rpc.ts handlers can throw them without importing
 * the router itself; rpc-host.ts re-exports both, so existing importers are
 * unaffected.
 */

/** Thrown by a handler when the acting user may not touch the requested resource. */
export class ForbiddenResource extends Error {}

/** Thrown when a param is missing or has the wrong shape. */
export class BadParams extends Error {}