@fluidframework/telemetry-utils 2.101.0 → 2.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +1 -1
- package/dist/error.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +1 -1
- package/lib/error.js.map +1 -1
- package/package.json +7 -7
- package/src/error.ts +1 -2
package/CHANGELOG.md
CHANGED
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAChC,IAAI,CACH,yBAAyB,EACvB,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,CACb,CACD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,wBAAwB,GAC9B,OAAO,CAAC,SAAS,CAInB;AAuGD;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,aAAa,E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,CAAC;QAC1B,wBAAwB,EAAE,MAAM,CAAC;QACjC,iCAAiC,EAAE,MAAM,CAAC;QAC1C,wBAAwB,EAAE,MAAM,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC;KAChB,EACD,cAAc,CAAC,EAAE,wBAAwB;CAgB1C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,gBAC/B,WAAW,KACtB;IACF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}
|
package/dist/error.js
CHANGED
|
@@ -194,7 +194,7 @@ class DataProcessingError extends errorLogging_js_1.LoggingError {
|
|
|
194
194
|
* @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.
|
|
195
195
|
*/
|
|
196
196
|
static wrapIfUnrecognized(originalError, dataProcessingCodepath, messageLike) {
|
|
197
|
-
return wrapDataProcessingErrorIfUnrecognized((errorMessage
|
|
197
|
+
return wrapDataProcessingErrorIfUnrecognized((errorMessage) => new DataProcessingError(errorMessage), originalError, dataProcessingCodepath, messageLike);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
exports.DataProcessingError = DataProcessingError;
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAKkD;AAGlD,uDAM2B;AAoB3B;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU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ACvB,GAAG,cAAc;YACjB,yBAAyB,EAAE,IAAI;SAC/B,CAAC,CAAC;QA1BY,cAAS,GAAG,0BAAe,CAAC,yBAAyB,CAAC;QA2BrE,IAAI,CAAC,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAxCD,8DAwCC;AAED;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC;AAhBU,QAAA,gCAAgC,oCAgB1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string, props?: ITelemetryBaseProperties) =>\n\t\t\t\tnew DataProcessingError(errorMessage, props),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAKkD;AAGlD,uDAM2B;AAoB3B;;;;;;;;GAQG;AACH,SAAgB,oBAA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ACf,oBAQC,EACD,cAAyC;QAEzC,KAAK,CAAC,OAAO,EAAE;YACd,GAAG,oBAAoB;YACvB,GAAG,cAAc;YACjB,yBAAyB,EAAE,IAAI;SAC/B,CAAC,CAAC;QA1BY,cAAS,GAAG,0BAAe,CAAC,yBAAyB,CAAC;QA2BrE,IAAI,CAAC,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAxCD,8DAwCC;AAED;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC;AAhBU,QAAA,gCAAgC,oCAgB1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string) => new DataProcessingError(errorMessage),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
|
package/lib/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":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B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}
|
package/lib/error.js
CHANGED
|
@@ -187,7 +187,7 @@ export class DataProcessingError extends LoggingError {
|
|
|
187
187
|
* @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.
|
|
188
188
|
*/
|
|
189
189
|
static wrapIfUnrecognized(originalError, dataProcessingCodepath, messageLike) {
|
|
190
|
-
return wrapDataProcessingErrorIfUnrecognized((errorMessage
|
|
190
|
+
return wrapDataProcessingErrorIfUnrecognized((errorMessage) => new DataProcessingError(errorMessage), originalError, dataProcessingCodepath, messageLike);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
/**
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAIf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,GACT,MAAM,mBAAmB,CAAC;AAoB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAChC,OAA4D,EAC5D,YAAoB,EACpB,QAAgB,EAChB,WAAyB,EACzB,QAAiC,EAAE,EACnC,eAAwB;IAExB,MAAM,WAAW,GAAG,KAA+C,CAAC;IACpE,MAAM,uBAAuB,GAAG,WAAW,CAAC,eAAe,CAAC;IAC5D,IAAI,CAAC;QACJ,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAC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C,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string, props?: ITelemetryBaseProperties) =>\n\t\t\t\tnew DataProcessingError(errorMessage, props),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAIf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,GACT,MAAM,mBAAmB,CAAC;AAoB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAChC,OAA4D,EAC5D,YAAoB,EACpB,QAAgB,EAChB,WAAyB,EACzB,QAAiC,EAAE,EACnC,eAAwB;IAExB,MAAM,WAAW,GAAG,KAA+C,CAAC;IACpE,MAA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QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string) => new DataProcessingError(errorMessage),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/telemetry-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.102.0",
|
|
4
4
|
"description": "Collection of telemetry relates utilities for Fluid",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,22 +69,22 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "~2.
|
|
73
|
-
"@fluidframework/core-interfaces": "~2.
|
|
74
|
-
"@fluidframework/core-utils": "~2.
|
|
75
|
-
"@fluidframework/driver-definitions": "~2.
|
|
72
|
+
"@fluid-internal/client-utils": "~2.102.0",
|
|
73
|
+
"@fluidframework/core-interfaces": "~2.102.0",
|
|
74
|
+
"@fluidframework/core-utils": "~2.102.0",
|
|
75
|
+
"@fluidframework/driver-definitions": "~2.102.0",
|
|
76
76
|
"debug": "^4.3.4",
|
|
77
77
|
"uuid": "^11.1.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
81
81
|
"@biomejs/biome": "~2.4.5",
|
|
82
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
82
|
+
"@fluid-internal/mocha-test-setup": "~2.102.0",
|
|
83
83
|
"@fluid-tools/build-cli": "^0.65.0",
|
|
84
84
|
"@fluidframework/build-common": "^2.0.3",
|
|
85
85
|
"@fluidframework/build-tools": "^0.65.0",
|
|
86
86
|
"@fluidframework/eslint-config-fluid": "^9.0.0",
|
|
87
|
-
"@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.
|
|
87
|
+
"@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.101.0",
|
|
88
88
|
"@microsoft/api-extractor": "7.58.1",
|
|
89
89
|
"@types/debug": "^4.1.5",
|
|
90
90
|
"@types/mocha": "^10.0.10",
|
package/src/error.ts
CHANGED
|
@@ -295,8 +295,7 @@ export class DataProcessingError extends LoggingError implements IErrorBase, IFl
|
|
|
295
295
|
messageLike?: MessageLike,
|
|
296
296
|
): IFluidErrorBase {
|
|
297
297
|
return wrapDataProcessingErrorIfUnrecognized(
|
|
298
|
-
(errorMessage: string
|
|
299
|
-
new DataProcessingError(errorMessage, props),
|
|
298
|
+
(errorMessage: string) => new DataProcessingError(errorMessage),
|
|
300
299
|
originalError,
|
|
301
300
|
dataProcessingCodepath,
|
|
302
301
|
messageLike,
|