@fluidframework/container-utils
Advanced tools
+7
-1
@@ -5,4 +5,5 @@ /*! | ||
| */ | ||
| import { ContainerErrorType, IGenericError, ICriticalContainerError } from "@fluidframework/container-definitions"; | ||
| import { ContainerErrorType, IGenericError, ICriticalContainerError, IErrorBase } from "@fluidframework/container-definitions"; | ||
| import { CustomErrorWithProps } from "@fluidframework/telemetry-utils"; | ||
| import { ITelemetryProperties } from "@fluidframework/common-definitions"; | ||
| /** | ||
@@ -16,2 +17,7 @@ * Generic error | ||
| } | ||
| export declare class DataCorruptionError extends CustomErrorWithProps implements IErrorBase { | ||
| readonly errorType = "dataCorruptionError"; | ||
| readonly canRetry = false; | ||
| constructor(errorMessage: string, props: ITelemetryProperties); | ||
| } | ||
| /** | ||
@@ -18,0 +24,0 @@ * Convert the error into one of the error types. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAUvE;;GAEG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,aAAa;IAKvE,QAAQ,CAAC,KAAK,EAAE,GAAG;IAJvB,QAAQ,CAAC,SAAS,mCAAmC;gBAGjD,YAAY,EAAE,MAAM,EACX,KAAK,EAAE,GAAG;CAI1B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,uBAAuB,CAwBxE"} | ||
| {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACb,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAU1E;;GAEG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,aAAa;IAKvE,QAAQ,CAAC,KAAK,EAAE,GAAG;IAJvB,QAAQ,CAAC,SAAS,mCAAmC;gBAGjD,YAAY,EAAE,MAAM,EACX,KAAK,EAAE,GAAG;CAI1B;AAED,qBAAa,mBAAoB,SAAQ,oBAAqB,YAAW,UAAU;IAC/E,QAAQ,CAAC,SAAS,yBAAyB;IAC3C,QAAQ,CAAC,QAAQ,SAAS;gBAGtB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,oBAAoB;CAIlC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,uBAAuB,CAwBxE"} |
+8
-0
@@ -29,2 +29,10 @@ "use strict"; | ||
| exports.GenericError = GenericError; | ||
| class DataCorruptionError extends telemetry_utils_1.CustomErrorWithProps { | ||
| constructor(errorMessage, props) { | ||
| super(errorMessage, props); | ||
| this.errorType = "dataCorruptionError"; | ||
| this.canRetry = false; | ||
| } | ||
| } | ||
| exports.DataCorruptionError = DataCorruptionError; | ||
| /** | ||
@@ -31,0 +39,0 @@ * Convert the error into one of the error types. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,+DAAsD;AACtD,iFAAmH;AACnH,qEAAuE;AAEvE,SAAS,gBAAgB,CAAC,KAAU;;IAChC,IAAI,cAAO,KAAK,0CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;QACpC,+DAA+D;QAC/D,OAAO,KAAK,CAAC,OAAO,CAAC;KACxB;IACD,OAAO,GAAG,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,sCAAoB;IAGlD,YACI,YAAoB,EACX,KAAU;QAEnB,KAAK,CAAC,YAAY,CAAC,CAAC;QAFX,UAAK,GAAL,KAAK,CAAK;QAJd,cAAS,GAAG,0CAAkB,CAAC,YAAY,CAAC;IAOrD,CAAC;CACJ;AATD,oCASC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAU;;IAC3C,qBAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC7C,MAAM,GAAG,GAAG,KAAK,CAAC;QAClB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,YAAY,sCAAoB,EAAE;YACxE,+DAA+D;YAC/D,OAAO,GAAG,CAAC;SACd;QAED,qCAAqC;QACrC,wDAAwD;QACxD,OAAO,IAAI,sCAAoB,CAC3B,gBAAgB,CAAC,KAAK,CAAC,EACvB;YACI,SAAS,QAAE,KAAK,CAAC,SAAS,uCAAI,0CAAkB,CAAC,YAAY,EAAA;YAC7D,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB,CACoB,CAAC;KAC7B;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KACpD;SAAM;QACH,OAAO,IAAI,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3D;AACL,CAAC;AAxBD,oDAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ContainerErrorType, IGenericError, ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { CustomErrorWithProps } from \"@fluidframework/telemetry-utils\";\n\nfunction messageFromError(error: any) {\n if (typeof error?.message === \"string\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return error.message;\n }\n return `${error}`;\n}\n\n/**\n * Generic error\n */\nexport class GenericError extends CustomErrorWithProps implements IGenericError {\n readonly errorType = ContainerErrorType.genericError;\n\n constructor(\n errorMessage: string,\n readonly error: any,\n ) {\n super(errorMessage);\n }\n}\n\n/**\n * Convert the error into one of the error types.\n * @param error - Error to be converted.\n */\nexport function CreateContainerError(error: any): ICriticalContainerError {\n assert(error !== undefined);\n\n if (typeof error === \"object\" && error !== null) {\n const err = error;\n if (error.errorType !== undefined && error instanceof CustomErrorWithProps) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return err;\n }\n\n // Only get properties we know about.\n // Grabbing all properties will expose PII in telemetry!\n return new CustomErrorWithProps(\n messageFromError(error),\n {\n errorType: error.errorType ?? ContainerErrorType.genericError,\n stack: error.stack,\n },\n ) as any as IGenericError;\n } else if (typeof error === \"string\") {\n return new GenericError(error, new Error(error));\n } else {\n return new GenericError(messageFromError(error), error);\n }\n}\n"]} | ||
| {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,+DAAsD;AACtD,iFAK+C;AAC/C,qEAAuE;AAGvE,SAAS,gBAAgB,CAAC,KAAU;;IAChC,IAAI,cAAO,KAAK,0CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;QACpC,+DAA+D;QAC/D,OAAO,KAAK,CAAC,OAAO,CAAC;KACxB;IACD,OAAO,GAAG,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,sCAAoB;IAGlD,YACI,YAAoB,EACX,KAAU;QAEnB,KAAK,CAAC,YAAY,CAAC,CAAC;QAFX,UAAK,GAAL,KAAK,CAAK;QAJd,cAAS,GAAG,0CAAkB,CAAC,YAAY,CAAC;IAOrD,CAAC;CACJ;AATD,oCASC;AAED,MAAa,mBAAoB,SAAQ,sCAAoB;IAIzD,YACI,YAAoB,EACpB,KAA2B;QAE3B,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAPtB,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,KAAK,CAAC;IAO1B,CAAC;CACJ;AAVD,kDAUC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAU;;IAC3C,qBAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC7C,MAAM,GAAG,GAAG,KAAK,CAAC;QAClB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,YAAY,sCAAoB,EAAE;YACxE,+DAA+D;YAC/D,OAAO,GAAG,CAAC;SACd;QAED,qCAAqC;QACrC,wDAAwD;QACxD,OAAO,IAAI,sCAAoB,CAC3B,gBAAgB,CAAC,KAAK,CAAC,EACvB;YACI,SAAS,QAAE,KAAK,CAAC,SAAS,uCAAI,0CAAkB,CAAC,YAAY,EAAA;YAC7D,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB,CACoB,CAAC;KAC7B;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KACpD;SAAM;QACH,OAAO,IAAI,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3D;AACL,CAAC;AAxBD,oDAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n ContainerErrorType,\n IGenericError,\n ICriticalContainerError,\n IErrorBase,\n} from \"@fluidframework/container-definitions\";\nimport { CustomErrorWithProps } from \"@fluidframework/telemetry-utils\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\nfunction messageFromError(error: any) {\n if (typeof error?.message === \"string\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return error.message;\n }\n return `${error}`;\n}\n\n/**\n * Generic error\n */\nexport class GenericError extends CustomErrorWithProps implements IGenericError {\n readonly errorType = ContainerErrorType.genericError;\n\n constructor(\n errorMessage: string,\n readonly error: any,\n ) {\n super(errorMessage);\n }\n}\n\nexport class DataCorruptionError extends CustomErrorWithProps implements IErrorBase {\n readonly errorType = \"dataCorruptionError\";\n readonly canRetry = false;\n\n constructor(\n errorMessage: string,\n props: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\n/**\n * Convert the error into one of the error types.\n * @param error - Error to be converted.\n */\nexport function CreateContainerError(error: any): ICriticalContainerError {\n assert(error !== undefined);\n\n if (typeof error === \"object\" && error !== null) {\n const err = error;\n if (error.errorType !== undefined && error instanceof CustomErrorWithProps) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return err;\n }\n\n // Only get properties we know about.\n // Grabbing all properties will expose PII in telemetry!\n return new CustomErrorWithProps(\n messageFromError(error),\n {\n errorType: error.errorType ?? ContainerErrorType.genericError,\n stack: error.stack,\n },\n ) as any as IGenericError;\n } else if (typeof error === \"string\") {\n return new GenericError(error, new Error(error));\n } else {\n return new GenericError(messageFromError(error), error);\n }\n}\n"]} |
@@ -8,3 +8,3 @@ /*! | ||
| export declare const pkgName = "@fluidframework/container-utils"; | ||
| export declare const pkgVersion = "0.29.3"; | ||
| export declare const pkgVersion = "0.29.4"; | ||
| //# sourceMappingURL=packageVersion.d.ts.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
| exports.pkgName = "@fluidframework/container-utils"; | ||
| exports.pkgVersion = "0.29.3"; | ||
| exports.pkgVersion = "0.29.4"; | ||
| //# sourceMappingURL=packageVersion.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEU,QAAA,OAAO,GAAG,iCAAiC,CAAC;AAC5C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-utils\";\nexport const pkgVersion = \"0.29.3\";\n"]} | ||
| {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEU,QAAA,OAAO,GAAG,iCAAiC,CAAC;AAC5C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-utils\";\nexport const pkgVersion = \"0.29.4\";\n"]} |
+7
-1
@@ -5,4 +5,5 @@ /*! | ||
| */ | ||
| import { ContainerErrorType, IGenericError, ICriticalContainerError } from "@fluidframework/container-definitions"; | ||
| import { ContainerErrorType, IGenericError, ICriticalContainerError, IErrorBase } from "@fluidframework/container-definitions"; | ||
| import { CustomErrorWithProps } from "@fluidframework/telemetry-utils"; | ||
| import { ITelemetryProperties } from "@fluidframework/common-definitions"; | ||
| /** | ||
@@ -16,2 +17,7 @@ * Generic error | ||
| } | ||
| export declare class DataCorruptionError extends CustomErrorWithProps implements IErrorBase { | ||
| readonly errorType = "dataCorruptionError"; | ||
| readonly canRetry = false; | ||
| constructor(errorMessage: string, props: ITelemetryProperties); | ||
| } | ||
| /** | ||
@@ -18,0 +24,0 @@ * Convert the error into one of the error types. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAUvE;;GAEG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,aAAa;IAKvE,QAAQ,CAAC,KAAK,EAAE,GAAG;IAJvB,QAAQ,CAAC,SAAS,mCAAmC;gBAGjD,YAAY,EAAE,MAAM,EACX,KAAK,EAAE,GAAG;CAI1B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,uBAAuB,CAwBxE"} | ||
| {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACb,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAU1E;;GAEG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,aAAa;IAKvE,QAAQ,CAAC,KAAK,EAAE,GAAG;IAJvB,QAAQ,CAAC,SAAS,mCAAmC;gBAGjD,YAAY,EAAE,MAAM,EACX,KAAK,EAAE,GAAG;CAI1B;AAED,qBAAa,mBAAoB,SAAQ,oBAAqB,YAAW,UAAU;IAC/E,QAAQ,CAAC,SAAS,yBAAyB;IAC3C,QAAQ,CAAC,QAAQ,SAAS;gBAGtB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,oBAAoB;CAIlC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,uBAAuB,CAwBxE"} |
+8
-1
@@ -6,3 +6,3 @@ /*! | ||
| import { assert } from "@fluidframework/common-utils"; | ||
| import { ContainerErrorType } from "@fluidframework/container-definitions"; | ||
| import { ContainerErrorType, } from "@fluidframework/container-definitions"; | ||
| import { CustomErrorWithProps } from "@fluidframework/telemetry-utils"; | ||
@@ -27,2 +27,9 @@ function messageFromError(error) { | ||
| } | ||
| export class DataCorruptionError extends CustomErrorWithProps { | ||
| constructor(errorMessage, props) { | ||
| super(errorMessage, props); | ||
| this.errorType = "dataCorruptionError"; | ||
| this.canRetry = false; | ||
| } | ||
| } | ||
| /** | ||
@@ -29,0 +36,0 @@ * Convert the error into one of the error types. |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAA0C,MAAM,uCAAuC,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,SAAS,gBAAgB,CAAC,KAAU;;IAChC,IAAI,cAAO,KAAK,0CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;QACpC,+DAA+D;QAC/D,OAAO,KAAK,CAAC,OAAO,CAAC;KACxB;IACD,OAAO,GAAG,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IAGlD,YACI,YAAoB,EACX,KAAU;QAEnB,KAAK,CAAC,YAAY,CAAC,CAAC;QAFX,UAAK,GAAL,KAAK,CAAK;QAJd,cAAS,GAAG,kBAAkB,CAAC,YAAY,CAAC;IAOrD,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAU;;IAC3C,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC7C,MAAM,GAAG,GAAG,KAAK,CAAC;QAClB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,YAAY,oBAAoB,EAAE;YACxE,+DAA+D;YAC/D,OAAO,GAAG,CAAC;SACd;QAED,qCAAqC;QACrC,wDAAwD;QACxD,OAAO,IAAI,oBAAoB,CAC3B,gBAAgB,CAAC,KAAK,CAAC,EACvB;YACI,SAAS,QAAE,KAAK,CAAC,SAAS,uCAAI,kBAAkB,CAAC,YAAY,EAAA;YAC7D,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB,CACoB,CAAC;KAC7B;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KACpD;SAAM;QACH,OAAO,IAAI,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3D;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ContainerErrorType, IGenericError, ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { CustomErrorWithProps } from \"@fluidframework/telemetry-utils\";\n\nfunction messageFromError(error: any) {\n if (typeof error?.message === \"string\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return error.message;\n }\n return `${error}`;\n}\n\n/**\n * Generic error\n */\nexport class GenericError extends CustomErrorWithProps implements IGenericError {\n readonly errorType = ContainerErrorType.genericError;\n\n constructor(\n errorMessage: string,\n readonly error: any,\n ) {\n super(errorMessage);\n }\n}\n\n/**\n * Convert the error into one of the error types.\n * @param error - Error to be converted.\n */\nexport function CreateContainerError(error: any): ICriticalContainerError {\n assert(error !== undefined);\n\n if (typeof error === \"object\" && error !== null) {\n const err = error;\n if (error.errorType !== undefined && error instanceof CustomErrorWithProps) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return err;\n }\n\n // Only get properties we know about.\n // Grabbing all properties will expose PII in telemetry!\n return new CustomErrorWithProps(\n messageFromError(error),\n {\n errorType: error.errorType ?? ContainerErrorType.genericError,\n stack: error.stack,\n },\n ) as any as IGenericError;\n } else if (typeof error === \"string\") {\n return new GenericError(error, new Error(error));\n } else {\n return new GenericError(messageFromError(error), error);\n }\n}\n"]} | ||
| {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EACH,kBAAkB,GAIrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,SAAS,gBAAgB,CAAC,KAAU;;IAChC,IAAI,cAAO,KAAK,0CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;QACpC,+DAA+D;QAC/D,OAAO,KAAK,CAAC,OAAO,CAAC;KACxB;IACD,OAAO,GAAG,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IAGlD,YACI,YAAoB,EACX,KAAU;QAEnB,KAAK,CAAC,YAAY,CAAC,CAAC;QAFX,UAAK,GAAL,KAAK,CAAK;QAJd,cAAS,GAAG,kBAAkB,CAAC,YAAY,CAAC;IAOrD,CAAC;CACJ;AAED,MAAM,OAAO,mBAAoB,SAAQ,oBAAoB;IAIzD,YACI,YAAoB,EACpB,KAA2B;QAE3B,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAPtB,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,KAAK,CAAC;IAO1B,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAU;;IAC3C,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC7C,MAAM,GAAG,GAAG,KAAK,CAAC;QAClB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,YAAY,oBAAoB,EAAE;YACxE,+DAA+D;YAC/D,OAAO,GAAG,CAAC;SACd;QAED,qCAAqC;QACrC,wDAAwD;QACxD,OAAO,IAAI,oBAAoB,CAC3B,gBAAgB,CAAC,KAAK,CAAC,EACvB;YACI,SAAS,QAAE,KAAK,CAAC,SAAS,uCAAI,kBAAkB,CAAC,YAAY,EAAA;YAC7D,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB,CACoB,CAAC;KAC7B;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KACpD;SAAM;QACH,OAAO,IAAI,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3D;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n ContainerErrorType,\n IGenericError,\n ICriticalContainerError,\n IErrorBase,\n} from \"@fluidframework/container-definitions\";\nimport { CustomErrorWithProps } from \"@fluidframework/telemetry-utils\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\nfunction messageFromError(error: any) {\n if (typeof error?.message === \"string\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return error.message;\n }\n return `${error}`;\n}\n\n/**\n * Generic error\n */\nexport class GenericError extends CustomErrorWithProps implements IGenericError {\n readonly errorType = ContainerErrorType.genericError;\n\n constructor(\n errorMessage: string,\n readonly error: any,\n ) {\n super(errorMessage);\n }\n}\n\nexport class DataCorruptionError extends CustomErrorWithProps implements IErrorBase {\n readonly errorType = \"dataCorruptionError\";\n readonly canRetry = false;\n\n constructor(\n errorMessage: string,\n props: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\n/**\n * Convert the error into one of the error types.\n * @param error - Error to be converted.\n */\nexport function CreateContainerError(error: any): ICriticalContainerError {\n assert(error !== undefined);\n\n if (typeof error === \"object\" && error !== null) {\n const err = error;\n if (error.errorType !== undefined && error instanceof CustomErrorWithProps) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return err;\n }\n\n // Only get properties we know about.\n // Grabbing all properties will expose PII in telemetry!\n return new CustomErrorWithProps(\n messageFromError(error),\n {\n errorType: error.errorType ?? ContainerErrorType.genericError,\n stack: error.stack,\n },\n ) as any as IGenericError;\n } else if (typeof error === \"string\") {\n return new GenericError(error, new Error(error));\n } else {\n return new GenericError(messageFromError(error), error);\n }\n}\n"]} |
@@ -8,3 +8,3 @@ /*! | ||
| export declare const pkgName = "@fluidframework/container-utils"; | ||
| export declare const pkgVersion = "0.29.3"; | ||
| export declare const pkgVersion = "0.29.4"; | ||
| //# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
| export const pkgName = "@fluidframework/container-utils"; | ||
| export const pkgVersion = "0.29.3"; | ||
| export const pkgVersion = "0.29.4"; | ||
| //# sourceMappingURL=packageVersion.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,iCAAiC,CAAC;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-utils\";\nexport const pkgVersion = \"0.29.3\";\n"]} | ||
| {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,iCAAiC,CAAC;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-utils\";\nexport const pkgVersion = \"0.29.4\";\n"]} |
+5
-4
| { | ||
| "name": "@fluidframework/container-utils", | ||
| "version": "0.29.3", | ||
| "version": "0.29.4", | ||
| "description": "Fluid container utils", | ||
@@ -54,5 +54,6 @@ "homepage": "https://fluidframework.com", | ||
| "dependencies": { | ||
| "@fluidframework/common-definitions": "^0.19.1", | ||
| "@fluidframework/common-utils": "^0.25.0", | ||
| "@fluidframework/container-definitions": "^0.29.3", | ||
| "@fluidframework/telemetry-utils": "^0.29.3", | ||
| "@fluidframework/container-definitions": "^0.29.4", | ||
| "@fluidframework/telemetry-utils": "^0.29.4", | ||
| "assert": "^2.0.0" | ||
@@ -63,3 +64,3 @@ }, | ||
| "@fluidframework/eslint-config-fluid": "^0.21.0", | ||
| "@fluidframework/mocha-test-setup": "^0.29.3", | ||
| "@fluidframework/mocha-test-setup": "^0.29.4", | ||
| "@microsoft/api-extractor": "^7.7.2", | ||
@@ -66,0 +67,0 @@ "@types/assert": "^1.5.1", |
+19
-1
@@ -7,4 +7,10 @@ /*! | ||
| import { assert } from "@fluidframework/common-utils"; | ||
| import { ContainerErrorType, IGenericError, ICriticalContainerError } from "@fluidframework/container-definitions"; | ||
| import { | ||
| ContainerErrorType, | ||
| IGenericError, | ||
| ICriticalContainerError, | ||
| IErrorBase, | ||
| } from "@fluidframework/container-definitions"; | ||
| import { CustomErrorWithProps } from "@fluidframework/telemetry-utils"; | ||
| import { ITelemetryProperties } from "@fluidframework/common-definitions"; | ||
@@ -33,2 +39,14 @@ function messageFromError(error: any) { | ||
| export class DataCorruptionError extends CustomErrorWithProps implements IErrorBase { | ||
| readonly errorType = "dataCorruptionError"; | ||
| readonly canRetry = false; | ||
| constructor( | ||
| errorMessage: string, | ||
| props: ITelemetryProperties, | ||
| ) { | ||
| super(errorMessage, props); | ||
| } | ||
| } | ||
| /** | ||
@@ -35,0 +53,0 @@ * Convert the error into one of the error types. |
@@ -9,2 +9,2 @@ /*! | ||
| export const pkgName = "@fluidframework/container-utils"; | ||
| export const pkgVersion = "0.29.3"; | ||
| export const pkgVersion = "0.29.4"; |
29939
12.18%382
12.68%5
25%