Type alias CaughtObjectReportJson

CaughtObjectReportJson: {
    $schema?: typeof CORJ_REPORT_OBJECT_JSON_SCHEMA_LINK | typeof CORJ_REPORT_ARRAY_JSON_SCHEMA_LINK;
    as_json: CorjJsonValue<CorjJsonPrimitive>;
    as_json_format: CorjAsJsonFormat | null;
    as_string: string | null;
    as_string_format?: CorjAsStringFormat | null;
    children?: (CaughtObjectReportJsonChild | null)[];
    children_omitted_reason?: string;
    children_sources: string[];
    constructor_name?: string | null;
    instanceof_error: boolean;
    message?: string | null;
    stack?: string | null;
    typeof: CaughtObjectTypeof;
    v?: typeof CORJ_VERSION;
}

Type declaration

  • Optional $schema?: typeof CORJ_REPORT_OBJECT_JSON_SCHEMA_LINK | typeof CORJ_REPORT_ARRAY_JSON_SCHEMA_LINK

    Optional link to JSON schema this object conforms to.
    Adding this field is controlled by CorjMakerOptions['metadataFields']['$schema']).

  • as_json: CorjJsonValue<CorjJsonPrimitive>

    A JSON object produced from caught object using format at as_json_format

    null value means that producing as_json property failed.
    Use onCaughtMaking option to access objects thrown when report JSON was being created.

    Links

  • as_json_format: CorjAsJsonFormat | null

    Indicates a method used to obtain the value of as_json.

    Adding this field is controlled by CorjMakerOptions['metadataFields']['as_json_format']).

  • as_string: string | null

    A string produced from caught object using format at as_string_format

    null value means that producing as_string property failed.
    Use onCaughtMaking option to access objects thrown when report JSON was being created.

  • Optional as_string_format?: CorjAsStringFormat | null

    Indicates a method used to obtain the value of as_string.

    • "String" means value was obtained with as_string = String(caught).

    Adding this field is controlled by CorjMakerOptions['metadataFields']['as_string_format']).

    Links

  • Optional children?: (CaughtObjectReportJsonChild | null)[]

    A flattened representation of tree of nested error objects, collected from properties listed in children_sources.

  • Optional children_omitted_reason?: string

    Is set if this caught object has fields reported in children_sources, but they were omitted by implementation.

  • children_sources: string[]

    Array of property names of caught object to collect into children property.

    Content of this field corresponds to a setting CorjMakerOptions['childrenSources']. Adding this field is controlled by CorjMakerOptions['metadataFields']['children_sources'].

  • Optional constructor_name?: string | null

    Result of

    typeof caught?.constructor?.name !== 'string'
    ? undefined
    : caught?.constructor?.name;

    undefined result is not included in result object.

    null value means that accessing constructor.name on caught object failed.
    Use onCaughtMaking option to access objects thrown when report JSON was being created.

    Links

    For example

    try { asdf.sdf } catch (caught) { console.log(caught.constructor.name) }
    

    will print "TypeError".

  • instanceof_error: boolean

    Result of

    caught instanceof Error
    
  • Optional message?: string | null

    Result of

    typeof (caught as any)?.message !== 'string'
    ? undefined
    : (caught as any)?.message;

    undefined result is not included in result object.

    Normally JS Error instances include a message property with a string.

    null value means that accessing message property on caught object failed.
    Use onCaughtMaking option to access objects thrown when report JSON was being created.

    Links

  • Optional stack?: string | null

    Result of

    typeof (caught as any)?.stack !== 'string'
    ? undefined
    : (caught as any)?.stack;

    undefined result is not included in result object.

    Normally JS Error instances include a stack property with a string, although the property is non-standard.

    null value means that accessing stack property on caught object failed.
    Use onCaughtMaking option to access objects thrown when report JSON was being created.

    Links

  • typeof: CaughtObjectTypeof

    Result of

    typeof caught
    
  • Optional v?: typeof CORJ_VERSION

    A version of report.
    Adding this field is controlled by CorjMakerOptions['metadataFields']['v']).