← All procedures
optional.err
This function wraps the error of a step that failed.
CLI- Package
- @procedures/optional · README
- Path
["optional","err"]- CLI
mark optional err --error <any>- As data
{"$proc":["optional","err"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/optional/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["optional","err"], { error: "<error>" });
console.log(JSON.stringify(result));From the command line
$ mark optional err --error <any>
As data, in a program
{ "$proc": ["optional", "err"], "input": { "error": "<error>" } }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"error": {}
},
"required": [
"error"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"tag": {
"type": "string",
"const": "err"
},
"error": {}
},
"required": [
"tag",
"error"
],
"additionalProperties": {}
}
}