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​

ConstructorDescription
(constructor)(message, props, omitPropsFromLogging)Create a new LoggingError

Properties​

PropertyTypeDescription
errorInstanceIdstring

Methods​

MethodReturn TypeDescription
addTelemetryProperties(props)voidAdd additional properties to be logged
getTelemetryProperties()ITelemetryPropertiesGet 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​

ParameterModifiersTypeDescription
messagestringError message to use for Error base class
propsoptionalITelemetryPropertiestelemetry props to include on the error for when it's logged
omitPropsFromLoggingoptionalSet<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​

ParameterTypeDescription
propsITelemetryProperties

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​

ParameterTypeDescription
idstring