← All procedures

client.throw

Throw an error

MCPCLIbrowser
Package
@procedures/client · README
Path
["client","throw"]
CLI
mark client throw --message <string>
MCP tool
client.throw on the dev-tools server
As data
{"$proc":["client","throw"],"input":{}}
Tags
core, control-flow

Try it in the Composer →

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";

for (const procedure of allCoreProcedures) {
  if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","throw"], { message: "<message>" });
console.log(JSON.stringify(result));

From the command line

$ mark client throw --message <string>

As data, in a program

{ "$proc": ["client", "throw"], "input": { "message": "<message>" } }

Input

FieldTypeRequired
messagestringyes
codestringno

Output

The schema does not list fields (any).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "message": {
        "type": "string",
        "description": "The error message"
      },
      "code": {
        "description": "The error code",
        "type": "string"
      }
    },
    "required": [
      "message"
    ],
    "additionalProperties": {}
  },
  "output": {
    "not": {},
    "description": "client.throw never gives a value: it throws"
  }
}