Skip to main content
Version: v1

LoggingError Class

Base class for "trusted" errors we create, whose properties can generally be logged to telemetry safely. All properties set on the object, or passed in (via the constructor or addTelemetryProperties), will be logged in accordance with their tag, if present.

PLEASE take care to avoid setting sensitive data on this object without proper tagging!

Signature

export declare class LoggingError extends Error implements ILoggingError, Omit<IFluidErrorBase, "errorType">

Extends: Error

Implements: ILoggingError, Omit<IFluidErrorBase

Constructors

Constructor Description
(constructor)(message, props, omitPropsFromLogging) Create a new LoggingError

Properties

Property Type Description
errorInstanceId string

Methods

Method Return Type Description
addTelemetryProperties(props) void Add additional properties to be logged
getTelemetryProperties() ITelemetryProperties Get all properties fit to be logged to telemetry for this error
overwriteErrorInstanceId(id) void

Constructor Details

(constructor)

Create a new LoggingError

Signature

constructor(message: string, props?: ITelemetryProperties, omitPropsFromLogging?: Set<string>);

Parameters

Parameter Modifiers Type Description
message string Error message to use for Error base class
props optional ITelemetryProperties telemetry props to include on the error for when it's logged
omitPropsFromLogging optional Set<string> properties by name to omit from telemetry props

Property Details

errorInstanceId

Signature

get errorInstanceId(): string;

Type: string

Method Details

addTelemetryProperties

Add additional properties to be logged

Signature

addTelemetryProperties(props: ITelemetryProperties): void;

Parameters

Parameter Type Description
props ITelemetryProperties

getTelemetryProperties

Get all properties fit to be logged to telemetry for this error

Signature

getTelemetryProperties(): ITelemetryProperties;

Returns

Return type: ITelemetryProperties

overwriteErrorInstanceId

Signature

overwriteErrorInstanceId(id: string): void;

Parameters

Parameter Type Description
id string