interface MakeMarshalOptions {
    errorIdNum: undefined | number;
    errorTagging: undefined | "off" | "on";
    marshalName: undefined | string;
    marshalSaveError: undefined | ((err: Error) => void);
    serializeBodyFormat: undefined | "capdata" | "smallcaps";
}

Properties

errorIdNum: undefined | number

Ascending numbers staring from here identify the sending of errors relative to this marshal instance.

errorTagging: undefined | "off" | "on"

controls whether serialized errors also carry tagging information, made from marshalName and numbers generated (currently by counting) starting at errorIdNum. The errorTagging option defaults to 'on'. Serialized errors are also logged to marshalSaveError only if tagging is 'on'.

marshalName: undefined | string

Used to identify sent errors.

marshalSaveError: undefined | ((err: Error) => void)

If errorTagging is 'on', then errors serialized by this marshal instance are also logged by calling marshalSaveError after annotateError associated that error with its errorId. Thus, if marshalSaveError in turn logs to the normal console, which is the default, then the console will show that note showing the associated errorId.

serializeBodyFormat: undefined | "capdata" | "smallcaps"

Formatting to use in the "body" property in objects returned from serialize. The body string for each case:

  • 'capdata' - a JSON string, from an encoding of passables into JSON, where some values are represented as objects with a '@qclass property.
  • 'smallcaps' - a JSON string prefixed with '#', which is an unambiguous signal since a valid JSON string cannot begin with '#'.