@itwin/core-bentley 5.1.0-dev.40 → 5.1.0-dev.42

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uCAAoC;AACpC,iDAA6E;AAC7E,mEAAgE;AAOhE;;GAEG;AACH,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,wCAAwC;IACxC,yCAAK,CAAA;IACL,8BAA8B;IAC9B,uCAAI,CAAA;IACJ,4BAA4B;IAC5B,6CAAO,CAAA;IACP,6BAA6B;IAC7B,yCAAK,CAAA;IACL,+EAA+E;IAC/E,uCAAI,CAAA;AACN,CAAC,EAXW,QAAQ,wBAAR,QAAQ,QAWnB;AAmCD;;;GAGG;AACH,MAAa,MAAM;IACP,MAAM,CAAC,SAAS,CAA0B;IAC1C,MAAM,CAAC,WAAW,CAA0B;IAC5C,MAAM,CAAC,QAAQ,CAA0B;IACzC,MAAM,CAAC,SAAS,CAA0B;IAE5C,MAAM,CAAC,kBAAkB,CAAkC;IAC3D,MAAM,CAAC,eAAe,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEpE,8EAA8E;IACvE,MAAM,KAAK,iBAAiB;QACjC,iJAAiJ;QACjJ,IAAI,SAAS,KAAK,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC5C,MAAM,CAAC,kBAAkB,GAAG,IAAI,iBAAO,EAAc,CAAC;QACxD,CAAC;QAED,OAAO,MAAM,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAEO,MAAM,CAAC,eAAe,GAAqD,EAAE,CAAC;IAEtF;;;OAGG;IACI,MAAM,KAAK,cAAc;QAC9B,kDAAkD;QAClD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAEO,MAAM,CAAC,SAAS,CAAuB;IAE/C;;;OAGG;I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O,CAAC,6CAAqB,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE;YAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,2BAAY,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,OAAO;gBACL,GAAG,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,2DAA2D;aACxH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,uDAAuD;IAChD,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,CAAC;;AAxCH,gCAyCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\nimport { BeEvent } from \"./BeEvent\";\nimport { BentleyError, IModelStatus, LoggingMetaData } from \"./BentleyError\";\nimport { BentleyLoggerCategory } from \"./BentleyLoggerCategory\";\n\n/** Defines the *signature* for a log function.\n * @public\n */\nexport type LogFunction = (category: string, message: string, metaData: LoggingMetaData) => void;\n\n/** Use to categorize logging messages by severity.\n * @public\n */\nexport enum LogLevel {\n /** Tracing and debugging - low level */\n Trace,\n /** Information - mid level */\n Info,\n /** Warnings - high level */\n Warning,\n /** Errors - highest level */\n Error,\n /** Higher than any real logging level. This is used to turn a category off. */\n None,\n}\n\n/** Identifies a logging category and the LogLevel that should be used for it. The LogLevel is specified by its string name.\n * @public\n */\nexport interface LoggerCategoryAndLevel {\n category: string;\n logLevel: string;\n}\n\n/** Specifies logging levels, including the default logging level and a set of categories and levels for them.\n * @public\n */\nexport interface LoggerLevelsConfig {\n defaultLevel?: string;\n categoryLevels?: LoggerCategoryAndLevel[];\n}\n\n/** A global set of metadata that should be included with every log message.\n * You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each\n * time a message is logged.\n * Each key-value pair of the object will be stringified and combined with the log message's per-call metadata.\n * The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys\n * are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else.\n * @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata.\n * @see [[Logger.staticMetaData]] to access the global metadata.\n * @beta\n */\nexport interface StaticLoggerMetaData {\n /** Add or update some metadata to be included with every logged message. */\n set(key: string, metadata: LoggingMetaData): void;\n /** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */\n delete(key: string): void;\n}\n\n/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control\n * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md).\n * @public\n */\nexport class Logger {\n protected static _logError: LogFunction | undefined;\n protected static _logWarning: LogFunction | undefined;\n protected static _logInfo: LogFunction | undefined;\n protected static _logTrace: LogFunction | undefined;\n\n private static _onLogLevelChanged: BeEvent<() => void> | undefined;\n private static _staticMetaData = new Map<string, LoggingMetaData>();\n\n /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */\n public static get onLogLevelChanged(): BeEvent<() => void> {\n // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.\n if (undefined === Logger._onLogLevelChanged) {\n Logger._onLogLevelChanged = new BeEvent<() => void>();\n }\n\n return Logger._onLogLevelChanged;\n }\n\n private static _categoryFilter: { [categoryName: string]: LogLevel | undefined } = {};\n\n /** Maps category names to the least severe level at which messages in that category should be displayed,\n * or `undefined` if a minimum has not been defined.\n * @see [[setLevel]] to change the minimum logging level for a category.\n */\n public static get categoryFilter(): Readonly<{ [categoryName: string]: LogLevel | undefined }> {\n // NOTE: this property is accessed by native code.\n return this._categoryFilter;\n }\n\n private static _minLevel: LogLevel | undefined;\n\n /** The least severe level at which messages should be displayed by default.\n * @see [[setLevelDefault]] to change this default.\n * @see [[setLevel]] to override this default for specific categories.\n */\n public static get minLevel(): LogLevel | undefined {\n // NOTE: this property is accessed by native code. */\n return this._minLevel;\n }\n\n /** Should the call stack be included when an exception is logged? */\n public static logExceptionCallstacks = false;\n\n /** Contains metadata that should be included with every logged message.\n * @beta\n */\n public static get staticMetaData(): StaticLoggerMetaData {\n return this._staticMetaData;\n }\n\n /** Initialize the logger streams. Should be called at application initialization time. */\n public static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void {\n Logger._logError = logError;\n Logger._logWarning = logWarning;\n Logger._logInfo = logInfo;\n Logger._logTrace = logTrace;\n Logger.turnOffLevelDefault();\n Logger.turnOffCategories();\n }\n\n /** Initialize the logger to output to the console. */\n public static initializeToConsole(): void {\n const logConsole = (level: string) => (category: string, message: string, metaData: LoggingMetaData) =>\n console.log(`${level} | ${category} | ${message} ${Logger.stringifyMetaData(metaData)}`); // eslint-disable-line no-console\n\n Logger.initialize(logConsole(\"Error\"), logConsole(\"Warning\"), logConsole(\"Info\"), logConsole(\"Trace\"));\n }\n\n /** merge the supplied metadata with all static metadata into one object */\n public static getMetaData(metaData?: LoggingMetaData): object {\n const metaObj = {};\n for (const meta of this._staticMetaData) {\n const val = BentleyError.getMetaData(meta[1]);\n if (val)\n Object.assign(metaObj, val);\n }\n Object.assign(metaObj, BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence\n return metaObj;\n }\n\n /** stringify the metadata for a log message by merging the supplied metadata with all static metadata into one object that is then `JSON.stringify`ed. */\n public static stringifyMetaData(metaData?: LoggingMetaData): string {\n const metaObj = this.getMetaData(metaData);\n return Object.keys(metaObj).length > 0 ? JSON.stringify(metaObj) : \"\";\n }\n\n /** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */\n public static setLevelDefault(minLevel: LogLevel): void {\n this._minLevel = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the\n * specified category should be displayed.\n */\n public static setLevel(category: string, minLevel: LogLevel) {\n Logger._categoryFilter[category] = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Interpret a string as the name of a LogLevel */\n public static parseLogLevel(str: string): LogLevel {\n switch (str.toUpperCase()) {\n case \"EXCEPTION\": return LogLevel.Error;\n case \"FATAL\": return LogLevel.Error;\n case \"ERROR\": return LogLevel.Error;\n case \"WARNING\": return LogLevel.Warning;\n case \"INFO\": return LogLevel.Info;\n case \"TRACE\": return LogLevel.Trace;\n case \"DEBUG\": return LogLevel.Trace;\n }\n return LogLevel.None;\n }\n\n /** Set the log level for multiple categories at once. Also see [[validateProps]] */\n public static configureLevels(cfg: LoggerLevelsConfig) {\n Logger.validateProps(cfg);\n if (cfg.defaultLevel !== undefined) {\n this.setLevelDefault(Logger.parseLogLevel(cfg.defaultLevel));\n }\n if (cfg.categoryLevels !== undefined) {\n for (const cl of cfg.categoryLevels) {\n this.setLevel(cl.category, Logger.parseLogLevel(cl.logLevel));\n }\n }\n }\n\n private static isLogLevel(v: string) {\n return LogLevel.hasOwnProperty(v);\n }\n\n /** Check that the specified object is a valid LoggerLevelsConfig. This is useful when reading a config from a .json file. */\n public static validateProps(config: any) {\n const validProps = [\"defaultLevel\", \"categoryLevels\"];\n for (const prop of Object.keys(config)) {\n if (!validProps.includes(prop))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);\n if (prop === \"defaultLevel\") {\n if (!Logger.isLogLevel(config.defaultLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);\n } else if (prop === \"categoryLevels\") {\n const value = config[prop];\n if (!Array.isArray(value))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);\n for (const item of config[prop]) {\n if (!item.hasOwnProperty(\"category\") || !item.hasOwnProperty(\"logLevel\"))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);\n if (!Logger.isLogLevel(item.logLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);\n }\n }\n }\n }\n\n /** Get the minimum logging level for the specified category. */\n public static getLevel(category: string): LogLevel | undefined {\n // Prefer the level set for this category specifically\n const minLevelForThisCategory = Logger.categoryFilter[category];\n if (minLevelForThisCategory !== undefined)\n return minLevelForThisCategory;\n\n // Fall back on the level set for the parent of this category.\n const parent = category.lastIndexOf(\".\");\n if (parent !== -1)\n return Logger.getLevel(category.slice(0, parent));\n\n // Fall back on the default level.\n return Logger.minLevel;\n }\n\n /** Turns off the least severe level at which messages should be displayed by default.\n * This turns off logging for all messages for which no category minimum level is defined.\n */\n public static turnOffLevelDefault(): void {\n Logger._minLevel = undefined;\n }\n\n /** Turns off all category level filters previously defined with [[Logger.setLevel]].\n */\n public static turnOffCategories(): void {\n Logger._categoryFilter = {};\n }\n\n /** Check if messages in the specified category should be displayed at this level of severity. */\n public static isEnabled(category: string, level: LogLevel): boolean {\n const minLevel = Logger.getLevel(category);\n return (minLevel !== undefined) && (level >= minLevel);\n }\n\n /** Log the specified message to the **error** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logError(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logError && Logger.isEnabled(category, LogLevel.Error))\n Logger._logError(category, message, metaData);\n }\n\n private static getExceptionMessage(err: unknown): string {\n if (err === undefined) {\n return \"Error: err is undefined.\";\n }\n if (err === null) {\n return \"Error: err is null.\";\n }\n const stack = Logger.logExceptionCallstacks ? `\\n${BentleyError.getErrorStack(err)}` : \"\";\n return BentleyError.getErrorMessage(err) + stack;\n }\n\n /** Log the specified exception.\n * For legacy [[BentleyError]] exceptions, the special \"exceptionType\" property will be added as metadata. Otherwise, all enumerable members of the exception are logged as metadata.\n * @param category The category of the message.\n * @param err The exception object.\n * @param log The logger output function to use - defaults to Logger.logError\n */\n public static logException(category: string, err: any, log: LogFunction = (_category, message, metaData) => Logger.logError(_category, message, metaData)): void {\n log(category, Logger.getExceptionMessage(err), () => {\n // For backwards compatibility, log BentleyError old way\n if (BentleyError.isError(err))\n return { ...BentleyError.getErrorMetadata(err), exceptionType: err?.constructor?.name ?? \"<Unknown>\" };\n\n // return a copy of the error, with non-enumerable members `message` and `stack` removed, as \"metadata\" for log.\n return { ...err };\n });\n }\n\n /** Log the specified message to the **warning** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logWarning(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logWarning && Logger.isEnabled(category, LogLevel.Warning))\n Logger._logWarning(category, message, metaData);\n }\n\n /** Log the specified message to the **info** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logInfo(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logInfo && Logger.isEnabled(category, LogLevel.Info))\n Logger._logInfo(category, message, metaData);\n }\n\n /** Log the specified message to the **trace** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logTrace(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logTrace && Logger.isEnabled(category, LogLevel.Trace))\n Logger._logTrace(category, message, metaData);\n }\n}\n\n/** Simple performance diagnostics utility.\n * It measures the time from construction to disposal. On disposal it logs the routine name along with\n * the duration in milliseconds.\n * It also logs the routine name at construction time so that nested calls can be disambiguated.\n *\n * The timings are logged using the log category **Performance** and log severity [[LogLevel.INFO]].\n * Enable those, if you want to capture timings.\n * @public\n */\nexport class PerfLogger implements Disposable {\n private static _severity: LogLevel = LogLevel.Info;\n\n private _operation: string;\n private _metaData?: LoggingMetaData;\n private _startTimeStamp: number;\n\n public constructor(operation: string, metaData?: LoggingMetaData) {\n this._operation = operation;\n this._metaData = metaData;\n\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity)) {\n this._startTimeStamp = 0;\n return;\n }\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);\n this._startTimeStamp = new Date().getTime(); // take timestamp\n }\n\n private logMessage(): void {\n const endTimeStamp: number = new Date().getTime();\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity))\n return;\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},END`, () => {\n const mdata = this._metaData ? BentleyError.getMetaData(this._metaData) : {};\n return {\n ...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention\n };\n });\n }\n\n public [Symbol.dispose](): void {\n this.logMessage();\n }\n\n /** @deprecated in 5.0 Use [Symbol.dispose] instead. */\n public dispose(): void {\n this[Symbol.dispose]();\n }\n}\n\n"]}
1
+ {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uCAAoC;AACpC,iDAA6E;AAC7E,mEAAgE;AAOhE;;GAEG;AACH,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,wCAAwC;IACxC,yCAAK,CAAA;IACL,8BAA8B;IAC9B,uCAAI,CAAA;IACJ,4BAA4B;IAC5B,6CAAO,CAAA;IACP,6BAA6B;IAC7B,yCAAK,CAAA;IACL,+EAA+E;IAC/E,uCAAI,CAAA;AACN,CAAC,EAXW,QAAQ,wBAAR,QAAQ,QAWnB;AAmCD;;;GAGG;AACH,MAAa,MAAM;IACP,MAAM,CAAC,SAAS,CAA0B;IAC1C,M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AAQ,CAAC;QAE1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,6CAAqB,CAAC,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/E,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,6CAAqB,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9F,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,iBAAiB;IAChE,CAAC;IAEO,UAAU;QAChB,MAAM,YAAY,GAAW,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,6CAAqB,CAAC,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5E,OAAO;QAET,MAAM,CAAC,OAAO,CAAC,6CAAqB,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE;YAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,2BAAY,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,OAAO;gBACL,GAAG,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,2DAA2D;aACxH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,qGAAqG;IAC9F,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,CAAC;;AAxCH,gCAyCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\nimport { BeEvent } from \"./BeEvent\";\nimport { BentleyError, IModelStatus, LoggingMetaData } from \"./BentleyError\";\nimport { BentleyLoggerCategory } from \"./BentleyLoggerCategory\";\n\n/** Defines the *signature* for a log function.\n * @public\n */\nexport type LogFunction = (category: string, message: string, metaData: LoggingMetaData) => void;\n\n/** Use to categorize logging messages by severity.\n * @public\n */\nexport enum LogLevel {\n /** Tracing and debugging - low level */\n Trace,\n /** Information - mid level */\n Info,\n /** Warnings - high level */\n Warning,\n /** Errors - highest level */\n Error,\n /** Higher than any real logging level. This is used to turn a category off. */\n None,\n}\n\n/** Identifies a logging category and the LogLevel that should be used for it. The LogLevel is specified by its string name.\n * @public\n */\nexport interface LoggerCategoryAndLevel {\n category: string;\n logLevel: string;\n}\n\n/** Specifies logging levels, including the default logging level and a set of categories and levels for them.\n * @public\n */\nexport interface LoggerLevelsConfig {\n defaultLevel?: string;\n categoryLevels?: LoggerCategoryAndLevel[];\n}\n\n/** A global set of metadata that should be included with every log message.\n * You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each\n * time a message is logged.\n * Each key-value pair of the object will be stringified and combined with the log message's per-call metadata.\n * The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys\n * are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else.\n * @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata.\n * @see [[Logger.staticMetaData]] to access the global metadata.\n * @beta\n */\nexport interface StaticLoggerMetaData {\n /** Add or update some metadata to be included with every logged message. */\n set(key: string, metadata: LoggingMetaData): void;\n /** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */\n delete(key: string): void;\n}\n\n/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control\n * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md).\n * @public\n */\nexport class Logger {\n protected static _logError: LogFunction | undefined;\n protected static _logWarning: LogFunction | undefined;\n protected static _logInfo: LogFunction | undefined;\n protected static _logTrace: LogFunction | undefined;\n\n private static _onLogLevelChanged: BeEvent<() => void> | undefined;\n private static _staticMetaData = new Map<string, LoggingMetaData>();\n\n /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */\n public static get onLogLevelChanged(): BeEvent<() => void> {\n // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.\n if (undefined === Logger._onLogLevelChanged) {\n Logger._onLogLevelChanged = new BeEvent<() => void>();\n }\n\n return Logger._onLogLevelChanged;\n }\n\n private static _categoryFilter: { [categoryName: string]: LogLevel | undefined } = {};\n\n /** Maps category names to the least severe level at which messages in that category should be displayed,\n * or `undefined` if a minimum has not been defined.\n * @see [[setLevel]] to change the minimum logging level for a category.\n */\n public static get categoryFilter(): Readonly<{ [categoryName: string]: LogLevel | undefined }> {\n // NOTE: this property is accessed by native code.\n return this._categoryFilter;\n }\n\n private static _minLevel: LogLevel | undefined;\n\n /** The least severe level at which messages should be displayed by default.\n * @see [[setLevelDefault]] to change this default.\n * @see [[setLevel]] to override this default for specific categories.\n */\n public static get minLevel(): LogLevel | undefined {\n // NOTE: this property is accessed by native code. */\n return this._minLevel;\n }\n\n /** Should the call stack be included when an exception is logged? */\n public static logExceptionCallstacks = false;\n\n /** Contains metadata that should be included with every logged message.\n * @beta\n */\n public static get staticMetaData(): StaticLoggerMetaData {\n return this._staticMetaData;\n }\n\n /** Initialize the logger streams. Should be called at application initialization time. */\n public static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void {\n Logger._logError = logError;\n Logger._logWarning = logWarning;\n Logger._logInfo = logInfo;\n Logger._logTrace = logTrace;\n Logger.turnOffLevelDefault();\n Logger.turnOffCategories();\n }\n\n /** Initialize the logger to output to the console. */\n public static initializeToConsole(): void {\n const logConsole = (level: string) => (category: string, message: string, metaData: LoggingMetaData) =>\n console.log(`${level} | ${category} | ${message} ${Logger.stringifyMetaData(metaData)}`); // eslint-disable-line no-console\n\n Logger.initialize(logConsole(\"Error\"), logConsole(\"Warning\"), logConsole(\"Info\"), logConsole(\"Trace\"));\n }\n\n /** merge the supplied metadata with all static metadata into one object */\n public static getMetaData(metaData?: LoggingMetaData): object {\n const metaObj = {};\n for (const meta of this._staticMetaData) {\n const val = BentleyError.getMetaData(meta[1]);\n if (val)\n Object.assign(metaObj, val);\n }\n Object.assign(metaObj, BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence\n return metaObj;\n }\n\n /** stringify the metadata for a log message by merging the supplied metadata with all static metadata into one object that is then `JSON.stringify`ed. */\n public static stringifyMetaData(metaData?: LoggingMetaData): string {\n const metaObj = this.getMetaData(metaData);\n return Object.keys(metaObj).length > 0 ? JSON.stringify(metaObj) : \"\";\n }\n\n /** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */\n public static setLevelDefault(minLevel: LogLevel): void {\n this._minLevel = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the\n * specified category should be displayed.\n */\n public static setLevel(category: string, minLevel: LogLevel) {\n Logger._categoryFilter[category] = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Interpret a string as the name of a LogLevel */\n public static parseLogLevel(str: string): LogLevel {\n switch (str.toUpperCase()) {\n case \"EXCEPTION\": return LogLevel.Error;\n case \"FATAL\": return LogLevel.Error;\n case \"ERROR\": return LogLevel.Error;\n case \"WARNING\": return LogLevel.Warning;\n case \"INFO\": return LogLevel.Info;\n case \"TRACE\": return LogLevel.Trace;\n case \"DEBUG\": return LogLevel.Trace;\n }\n return LogLevel.None;\n }\n\n /** Set the log level for multiple categories at once. Also see [[validateProps]] */\n public static configureLevels(cfg: LoggerLevelsConfig) {\n Logger.validateProps(cfg);\n if (cfg.defaultLevel !== undefined) {\n this.setLevelDefault(Logger.parseLogLevel(cfg.defaultLevel));\n }\n if (cfg.categoryLevels !== undefined) {\n for (const cl of cfg.categoryLevels) {\n this.setLevel(cl.category, Logger.parseLogLevel(cl.logLevel));\n }\n }\n }\n\n private static isLogLevel(v: string) {\n return LogLevel.hasOwnProperty(v);\n }\n\n /** Check that the specified object is a valid LoggerLevelsConfig. This is useful when reading a config from a .json file. */\n public static validateProps(config: any) {\n const validProps = [\"defaultLevel\", \"categoryLevels\"];\n for (const prop of Object.keys(config)) {\n if (!validProps.includes(prop))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);\n if (prop === \"defaultLevel\") {\n if (!Logger.isLogLevel(config.defaultLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);\n } else if (prop === \"categoryLevels\") {\n const value = config[prop];\n if (!Array.isArray(value))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);\n for (const item of config[prop]) {\n if (!item.hasOwnProperty(\"category\") || !item.hasOwnProperty(\"logLevel\"))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);\n if (!Logger.isLogLevel(item.logLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);\n }\n }\n }\n }\n\n /** Get the minimum logging level for the specified category. */\n public static getLevel(category: string): LogLevel | undefined {\n // Prefer the level set for this category specifically\n const minLevelForThisCategory = Logger.categoryFilter[category];\n if (minLevelForThisCategory !== undefined)\n return minLevelForThisCategory;\n\n // Fall back on the level set for the parent of this category.\n const parent = category.lastIndexOf(\".\");\n if (parent !== -1)\n return Logger.getLevel(category.slice(0, parent));\n\n // Fall back on the default level.\n return Logger.minLevel;\n }\n\n /** Turns off the least severe level at which messages should be displayed by default.\n * This turns off logging for all messages for which no category minimum level is defined.\n */\n public static turnOffLevelDefault(): void {\n Logger._minLevel = undefined;\n }\n\n /** Turns off all category level filters previously defined with [[Logger.setLevel]].\n */\n public static turnOffCategories(): void {\n Logger._categoryFilter = {};\n }\n\n /** Check if messages in the specified category should be displayed at this level of severity. */\n public static isEnabled(category: string, level: LogLevel): boolean {\n const minLevel = Logger.getLevel(category);\n return (minLevel !== undefined) && (level >= minLevel);\n }\n\n /** Log the specified message to the **error** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logError(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logError && Logger.isEnabled(category, LogLevel.Error))\n Logger._logError(category, message, metaData);\n }\n\n private static getExceptionMessage(err: unknown): string {\n if (err === undefined) {\n return \"Error: err is undefined.\";\n }\n if (err === null) {\n return \"Error: err is null.\";\n }\n const stack = Logger.logExceptionCallstacks ? `\\n${BentleyError.getErrorStack(err)}` : \"\";\n return BentleyError.getErrorMessage(err) + stack;\n }\n\n /** Log the specified exception.\n * For legacy [[BentleyError]] exceptions, the special \"exceptionType\" property will be added as metadata. Otherwise, all enumerable members of the exception are logged as metadata.\n * @param category The category of the message.\n * @param err The exception object.\n * @param log The logger output function to use - defaults to Logger.logError\n */\n public static logException(category: string, err: any, log: LogFunction = (_category, message, metaData) => Logger.logError(_category, message, metaData)): void {\n log(category, Logger.getExceptionMessage(err), () => {\n // For backwards compatibility, log BentleyError old way\n if (BentleyError.isError(err))\n return { ...BentleyError.getErrorMetadata(err), exceptionType: err?.constructor?.name ?? \"<Unknown>\" };\n\n // return a copy of the error, with non-enumerable members `message` and `stack` removed, as \"metadata\" for log.\n return { ...err };\n });\n }\n\n /** Log the specified message to the **warning** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logWarning(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logWarning && Logger.isEnabled(category, LogLevel.Warning))\n Logger._logWarning(category, message, metaData);\n }\n\n /** Log the specified message to the **info** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logInfo(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logInfo && Logger.isEnabled(category, LogLevel.Info))\n Logger._logInfo(category, message, metaData);\n }\n\n /** Log the specified message to the **trace** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logTrace(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logTrace && Logger.isEnabled(category, LogLevel.Trace))\n Logger._logTrace(category, message, metaData);\n }\n}\n\n/** Simple performance diagnostics utility.\n * It measures the time from construction to disposal. On disposal it logs the routine name along with\n * the duration in milliseconds.\n * It also logs the routine name at construction time so that nested calls can be disambiguated.\n *\n * The timings are logged using the log category **Performance** and log severity [[LogLevel.INFO]].\n * Enable those, if you want to capture timings.\n * @public\n */\nexport class PerfLogger implements Disposable {\n private static _severity: LogLevel = LogLevel.Info;\n\n private _operation: string;\n private _metaData?: LoggingMetaData;\n private _startTimeStamp: number;\n\n public constructor(operation: string, metaData?: LoggingMetaData) {\n this._operation = operation;\n this._metaData = metaData;\n\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity)) {\n this._startTimeStamp = 0;\n return;\n }\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);\n this._startTimeStamp = new Date().getTime(); // take timestamp\n }\n\n private logMessage(): void {\n const endTimeStamp: number = new Date().getTime();\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity))\n return;\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},END`, () => {\n const mdata = this._metaData ? BentleyError.getMetaData(this._metaData) : {};\n return {\n ...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention\n };\n });\n }\n\n public [Symbol.dispose](): void {\n this.logMessage();\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose(): void {\n this[Symbol.dispose]();\n }\n}\n\n"]}
@@ -5,7 +5,7 @@ import type { SpanAttributes, SpanContext, SpanOptions, Tracer } from "@opentele
5
5
  /**
6
6
  * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)
7
7
  * @public
8
- * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
8
+ * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
9
9
  */
10
10
  export declare enum SpanKind {
11
11
  INTERNAL = 0,
@@ -17,7 +17,7 @@ export declare enum SpanKind {
17
17
  /**
18
18
  * Enables OpenTelemetry tracing in addition to traditional logging.
19
19
  * @public
20
- * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
20
+ * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
21
21
  */
22
22
  export declare class Tracing {
23
23
  private static _tracer?;
@@ -13,7 +13,7 @@ const Logger_1 = require("./Logger");
13
13
  /**
14
14
  * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)
15
15
  * @public
16
- * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
16
+ * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
17
17
  */
18
18
  var SpanKind;
19
19
  (function (SpanKind) {
@@ -73,7 +73,7 @@ function flattenObject(obj) {
73
73
  /**
74
74
  * Enables OpenTelemetry tracing in addition to traditional logging.
75
75
  * @public
76
- * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
76
+ * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
77
77
  */
78
78
  class Tracing {
79
79
  static _tracer;
@@ -1 +1 @@
1
- {"version":3,"file":"Tracing.js","sourceRoot":"","sources":["../../src/Tracing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,qCAAyD;AAEzD,kGAAkG;AAClG;;;;GAIG;AACH,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,+CAAY,CAAA;IACZ,2CAAU,CAAA;IACV,2CAAU,CAAA;IACV,+CAAY,CAAA;IACZ,+CAAY,CAAA;AACd,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,CAAC;AACxF,CAAC;AAED,6GAA6G;AAC7G,iJAAiJ;AACjJ,SAAS,qBAAqB,CAAC,GAAY;IACzC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACrB,OAAO,KAAK,CAAC;IAEf,IAAI,QAAQ,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;YAC/B,SAAS;QAEX,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,OAAO,CAAC,CAAC;YACpB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBACtB,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,IAAI,OAAO,CA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AED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,UAA0B;QACpD,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF;AAnGD,0BAmGC;AAED,oDAAoD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\nimport type { ContextAPI, SpanAttributes, SpanAttributeValue, SpanContext, SpanOptions, TraceAPI, Tracer } from \"@opentelemetry/api\";\nimport { LogFunction, Logger, LogLevel } from \"./Logger\";\n\n// re-export so that consumers can construct full SpanOptions object without external dependencies\n/**\n * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)\n * @public\n * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\n */\nexport enum SpanKind {\n INTERNAL = 0,\n SERVER = 1,\n CLIENT = 2,\n PRODUCER = 3,\n CONSUMER = 4\n}\n\nfunction isValidPrimitive(val: unknown): val is SpanAttributeValue {\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"boolean\";\n}\n\n// Only _homogenous_ arrays of strings, numbers, or booleans are supported as OpenTelemetry Attribute values.\n// Per the spec (https://opentelemetry.io/docs/reference/specification/common/common/#attribute), empty arrays and null values are supported too.\nfunction isValidPrimitiveArray(val: unknown): val is SpanAttributeValue {\n if (!Array.isArray(val))\n return false;\n\n let itemType;\n for (const x of val) {\n if (x === undefined || x === null)\n continue;\n\n if (!itemType) {\n itemType = typeof x;\n if (!isValidPrimitive(x))\n return false;\n }\n\n if (typeof x !== itemType)\n return false;\n }\n return true;\n}\n\nfunction isPlainObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;\n}\n\nfunction* getFlatEntries(obj: unknown, path = \"\"): Iterable<[string, SpanAttributeValue]> {\n if (isValidPrimitiveArray(obj)) {\n yield [path, obj];\n return;\n }\n\n // Prefer JSON serialization over flattening for any non-POJO types.\n // There's just too many ways trying to flatten those can go wrong (Dates, Buffers, TypedArrays, etc.)\n if (!isPlainObject(obj) && !Array.isArray(obj)) {\n yield [path, isValidPrimitive(obj) ? obj : JSON.stringify(obj)];\n return;\n }\n\n // Always serialize empty objects/arrays as empty array values\n const entries = Object.entries(obj);\n if (entries.length === 0)\n yield [path, []];\n\n for (const [key, val] of entries)\n yield* getFlatEntries(val, (path === \"\") ? key : `${path}.${key}`);\n}\n\nfunction flattenObject(obj: object): SpanAttributes {\n return Object.fromEntries(getFlatEntries(obj));\n}\n\n/* eslint-disable @typescript-eslint/no-deprecated -- lots of self-references here... */\n\n/**\n * Enables OpenTelemetry tracing in addition to traditional logging.\n * @public\n * @deprecated in 4.4 - might be removed in next major version. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\n */\nexport class Tracing {\n private static _tracer?: Tracer;\n private static _openTelemetry?: { trace: Pick<TraceAPI, \"setSpan\" | \"setSpanContext\" | \"getSpan\">, context: Pick<ContextAPI, \"active\" | \"with\"> };\n\n /**\n * If OpenTelemetry tracing is enabled, creates a new span and runs the provided function in it.\n * If OpenTelemetry tracing is _not_ enabled, runs the provided function.\n * @param name name of the new span\n * @param fn function to run inside the new span\n * @param options span options\n * @param parentContext optional context used to retrieve parent span id\n */\n public static async withSpan<T>(name: string, fn: () => Promise<T>, options?: SpanOptions, parentContext?: SpanContext): Promise<T> {\n if (Tracing._tracer === undefined || Tracing._openTelemetry === undefined)\n return fn();\n\n // this case is for context propagation - parentContext is typically constructed from HTTP headers\n const parent = parentContext === undefined\n ? Tracing._openTelemetry.context.active()\n : Tracing._openTelemetry.trace.setSpanContext(Tracing._openTelemetry.context.active(), parentContext);\n\n return Tracing._openTelemetry.context.with(\n Tracing._openTelemetry.trace.setSpan(\n parent,\n Tracing._tracer.startSpan(name, options, Tracing._openTelemetry.context.active()),\n ),\n async () => {\n try {\n return await fn();\n } catch (err) {\n if (err instanceof Error) // ignore non-Error throws, such as RpcControlResponse\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttribute(\"error\", true);\n throw err;\n } finally {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.end();\n }\n },\n );\n }\n\n /**\n * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation\n * @param e error (exception) object\n */\n public static recordException(e: Error) {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);\n }\n\n /**\n * Enable logging to OpenTelemetry. [[Tracing.withSpan]] will be enabled, all log entries will be attached to active span as span events.\n * [IModelHost.startup]($backend) will call this automatically if the `enableOpenTelemetry` option is enabled and it succeeds in requiring `@opentelemetry/api`.\n * @note Node.js OpenTelemetry SDK should be initialized by the user.\n */\n public static enableOpenTelemetry(tracer: Tracer, api: typeof Tracing._openTelemetry) {\n Tracing._tracer = tracer;\n Tracing._openTelemetry = api;\n Logger.logTrace = Tracing.withOpenTelemetry(LogLevel.Trace, Logger.logTrace.bind(Logger)).bind(Logger);\n Logger.logInfo = Tracing.withOpenTelemetry(LogLevel.Info, Logger.logInfo.bind(Logger)).bind(Logger);\n Logger.logWarning = Tracing.withOpenTelemetry(LogLevel.Warning, Logger.logWarning.bind(Logger)).bind(Logger);\n Logger.logError = Tracing.withOpenTelemetry(LogLevel.Error, Logger.logError.bind(Logger)).bind(Logger);\n }\n\n private static withOpenTelemetry(level: LogLevel, base: LogFunction, isError: boolean = false): LogFunction {\n return (category, message, metaData) => {\n const oTelContext = Tracing._openTelemetry?.context.active();\n if (Tracing._openTelemetry === undefined || oTelContext === undefined)\n return base(category, message, metaData);\n\n const serializedMetadata = Logger.getMetaData(metaData);\n if (Logger.isEnabled(category, level)) {\n try {\n Tracing._openTelemetry?.trace\n .getSpan(Tracing._openTelemetry.context.active())\n ?.addEvent(message, {\n ...flattenObject(serializedMetadata),\n error: isError,\n loggerCategory: category,\n });\n } catch { } // avoid throwing random errors (with stack trace mangled by async hooks) when openTelemetry collector doesn't work\n\n const spanContext = Tracing._openTelemetry.trace.getSpan(oTelContext)?.spanContext();\n base(category, message, {\n ...serializedMetadata,\n /* eslint-disable @typescript-eslint/naming-convention */\n trace_id: spanContext?.traceId,\n span_id: spanContext?.spanId,\n trace_flags: spanContext?.traceFlags,\n /* eslint-enable @typescript-eslint/naming-convention */\n });\n }\n };\n }\n\n /** Set attributes on currently active openTelemetry span. Doesn't do anything if openTelemetry logging is not initialized.\n * @param attributes The attributes to set\n */\n public static setAttributes(attributes: SpanAttributes) {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttributes(attributes);\n }\n}\n\n/* eslint-enable @typescript-eslint/no-deprecated */\n"]}
1
+ {"version":3,"file":"Tracing.js","sourceRoot":"","sources":["../../src/Tracing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,qCAAyD;AAEzD,kGAAkG;AAClG;;;;GAIG;AACH,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,+CAAY,CAAA;IACZ,2CAAU,CAAA;IACV,2CAAU,CAAA;IACV,+CAAY,CAAA;IACZ,+CAAY,CAAA;AACd,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,CAAC;AACxF,CAAC;AAED,6GAA6G;AAC7G,iJAAiJ;AACjJ,SAAS,qBAAqB,CAAC,GAAY;IACzC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG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cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;gBACrF,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE;oBACtB,GAAG,kBAAkB;oBACrB,yDAAyD;oBACzD,QAAQ,EAAE,WAAW,EAAE,OAAO;oBAC9B,OAAO,EAAE,WAAW,EAAE,MAAM;oBAC5B,WAAW,EAAE,WAAW,EAAE,UAAU;oBACpC,wDAAwD;iBACzD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,UAA0B;QACpD,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF;AAnGD,0BAmGC;AAED,oDAAoD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\nimport type { ContextAPI, SpanAttributes, SpanAttributeValue, SpanContext, SpanOptions, TraceAPI, Tracer } from \"@opentelemetry/api\";\nimport { LogFunction, Logger, LogLevel } from \"./Logger\";\n\n// re-export so that consumers can construct full SpanOptions object without external dependencies\n/**\n * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)\n * @public\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\n */\nexport enum SpanKind {\n INTERNAL = 0,\n SERVER = 1,\n CLIENT = 2,\n PRODUCER = 3,\n CONSUMER = 4\n}\n\nfunction isValidPrimitive(val: unknown): val is SpanAttributeValue {\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"boolean\";\n}\n\n// Only _homogenous_ arrays of strings, numbers, or booleans are supported as OpenTelemetry Attribute values.\n// Per the spec (https://opentelemetry.io/docs/reference/specification/common/common/#attribute), empty arrays and null values are supported too.\nfunction isValidPrimitiveArray(val: unknown): val is SpanAttributeValue {\n if (!Array.isArray(val))\n return false;\n\n let itemType;\n for (const x of val) {\n if (x === undefined || x === null)\n continue;\n\n if (!itemType) {\n itemType = typeof x;\n if (!isValidPrimitive(x))\n return false;\n }\n\n if (typeof x !== itemType)\n return false;\n }\n return true;\n}\n\nfunction isPlainObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;\n}\n\nfunction* getFlatEntries(obj: unknown, path = \"\"): Iterable<[string, SpanAttributeValue]> {\n if (isValidPrimitiveArray(obj)) {\n yield [path, obj];\n return;\n }\n\n // Prefer JSON serialization over flattening for any non-POJO types.\n // There's just too many ways trying to flatten those can go wrong (Dates, Buffers, TypedArrays, etc.)\n if (!isPlainObject(obj) && !Array.isArray(obj)) {\n yield [path, isValidPrimitive(obj) ? obj : JSON.stringify(obj)];\n return;\n }\n\n // Always serialize empty objects/arrays as empty array values\n const entries = Object.entries(obj);\n if (entries.length === 0)\n yield [path, []];\n\n for (const [key, val] of entries)\n yield* getFlatEntries(val, (path === \"\") ? key : `${path}.${key}`);\n}\n\nfunction flattenObject(obj: object): SpanAttributes {\n return Object.fromEntries(getFlatEntries(obj));\n}\n\n/* eslint-disable @typescript-eslint/no-deprecated -- lots of self-references here... */\n\n/**\n * Enables OpenTelemetry tracing in addition to traditional logging.\n * @public\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\n */\nexport class Tracing {\n private static _tracer?: Tracer;\n private static _openTelemetry?: { trace: Pick<TraceAPI, \"setSpan\" | \"setSpanContext\" | \"getSpan\">, context: Pick<ContextAPI, \"active\" | \"with\"> };\n\n /**\n * If OpenTelemetry tracing is enabled, creates a new span and runs the provided function in it.\n * If OpenTelemetry tracing is _not_ enabled, runs the provided function.\n * @param name name of the new span\n * @param fn function to run inside the new span\n * @param options span options\n * @param parentContext optional context used to retrieve parent span id\n */\n public static async withSpan<T>(name: string, fn: () => Promise<T>, options?: SpanOptions, parentContext?: SpanContext): Promise<T> {\n if (Tracing._tracer === undefined || Tracing._openTelemetry === undefined)\n return fn();\n\n // this case is for context propagation - parentContext is typically constructed from HTTP headers\n const parent = parentContext === undefined\n ? Tracing._openTelemetry.context.active()\n : Tracing._openTelemetry.trace.setSpanContext(Tracing._openTelemetry.context.active(), parentContext);\n\n return Tracing._openTelemetry.context.with(\n Tracing._openTelemetry.trace.setSpan(\n parent,\n Tracing._tracer.startSpan(name, options, Tracing._openTelemetry.context.active()),\n ),\n async () => {\n try {\n return await fn();\n } catch (err) {\n if (err instanceof Error) // ignore non-Error throws, such as RpcControlResponse\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttribute(\"error\", true);\n throw err;\n } finally {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.end();\n }\n },\n );\n }\n\n /**\n * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation\n * @param e error (exception) object\n */\n public static recordException(e: Error) {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);\n }\n\n /**\n * Enable logging to OpenTelemetry. [[Tracing.withSpan]] will be enabled, all log entries will be attached to active span as span events.\n * [IModelHost.startup]($backend) will call this automatically if the `enableOpenTelemetry` option is enabled and it succeeds in requiring `@opentelemetry/api`.\n * @note Node.js OpenTelemetry SDK should be initialized by the user.\n */\n public static enableOpenTelemetry(tracer: Tracer, api: typeof Tracing._openTelemetry) {\n Tracing._tracer = tracer;\n Tracing._openTelemetry = api;\n Logger.logTrace = Tracing.withOpenTelemetry(LogLevel.Trace, Logger.logTrace.bind(Logger)).bind(Logger);\n Logger.logInfo = Tracing.withOpenTelemetry(LogLevel.Info, Logger.logInfo.bind(Logger)).bind(Logger);\n Logger.logWarning = Tracing.withOpenTelemetry(LogLevel.Warning, Logger.logWarning.bind(Logger)).bind(Logger);\n Logger.logError = Tracing.withOpenTelemetry(LogLevel.Error, Logger.logError.bind(Logger)).bind(Logger);\n }\n\n private static withOpenTelemetry(level: LogLevel, base: LogFunction, isError: boolean = false): LogFunction {\n return (category, message, metaData) => {\n const oTelContext = Tracing._openTelemetry?.context.active();\n if (Tracing._openTelemetry === undefined || oTelContext === undefined)\n return base(category, message, metaData);\n\n const serializedMetadata = Logger.getMetaData(metaData);\n if (Logger.isEnabled(category, level)) {\n try {\n Tracing._openTelemetry?.trace\n .getSpan(Tracing._openTelemetry.context.active())\n ?.addEvent(message, {\n ...flattenObject(serializedMetadata),\n error: isError,\n loggerCategory: category,\n });\n } catch { } // avoid throwing random errors (with stack trace mangled by async hooks) when openTelemetry collector doesn't work\n\n const spanContext = Tracing._openTelemetry.trace.getSpan(oTelContext)?.spanContext();\n base(category, message, {\n ...serializedMetadata,\n /* eslint-disable @typescript-eslint/naming-convention */\n trace_id: spanContext?.traceId,\n span_id: spanContext?.spanId,\n trace_flags: spanContext?.traceFlags,\n /* eslint-enable @typescript-eslint/naming-convention */\n });\n }\n };\n }\n\n /** Set attributes on currently active openTelemetry span. Doesn't do anything if openTelemetry logging is not initialized.\n * @param attributes The attributes to set\n */\n public static setAttributes(attributes: SpanAttributes) {\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttributes(attributes);\n }\n}\n\n/* eslint-enable @typescript-eslint/no-deprecated */\n"]}
@@ -310,7 +310,7 @@ export declare enum GeoServiceStatus {
310
310
  VerticalDatumConvertError = 147460,
311
311
  CSMapError = 147461,
312
312
  /**
313
- * @deprecated in 5.0. This status is never returned.
313
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. This status is never returned.
314
314
  */
315
315
  Pending = 147462
316
316
  }
@@ -318,7 +318,7 @@ export var GeoServiceStatus;
318
318
  GeoServiceStatus[GeoServiceStatus["VerticalDatumConvertError"] = 147460] = "VerticalDatumConvertError";
319
319
  GeoServiceStatus[GeoServiceStatus["CSMapError"] = 147461] = "CSMapError";
320
320
  /**
321
- * @deprecated in 5.0. This status is never returned.
321
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. This status is never returned.
322
322
  */
323
323
  GeoServiceStatus[GeoServiceStatus["Pending"] = 147462] = "Pending";
324
324
  })(GeoServiceStatus || (GeoServiceStatus = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"BentleyError.js","sourceRoot":"","sources":["../../src/BentleyError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA4BxC,YAAY;AACZ,MAAM,KAAW,UAAU,CA8B1B;AA9BD,WAAiB,UAAU;IACzB;;OAEG;IACH,SAAgB,MAAM,CAAuB,IAAqB;QAChE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,6DAA6D;QAC/F,OAAO,GAAQ,CAAC;IAClB,CAAC;IALe,iBAAM,SAKrB,CAAA;IAED;;OAEG;IACH,SAAgB,UAAU,CAAuB,IAAqB;QACpE,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAFe,qBAAU,aAEzB,CAAA;IAED;;;;;;;MAOE;IACF,SAAgB,OAAO,CAAuB,KAAc,EAAE,KAAa,EAAE,GAAY;QACvF,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IA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ACrC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI;gBACnD,OAAO,QAAQ,CAAC;QACpB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,KAAc;QACxC,MAAM,UAAU,GAAe;YAC7B,OAAO,EAAE,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC;SAC7C,CAAC;QAEF,MAAM,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,KAAK;YACP,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;QAE3B,MAAM,QAAQ,GAAG,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,QAAQ;YACV,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEjC,OAAO,UAAU,CAAC;IACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Errors\n */\n\nimport { DbResult } from \"./BeSQLite\";\nimport { RepositoryStatus } from \"./internal/RepositoryStatus\";\nimport { JsonUtils } from \"./JsonUtils\";\n\n/** Uniquely identifies a specific kind of [[ITwinError]].\n * @beta\n */\nexport interface ITwinErrorId {\n /** A \"namespace\" serving as a qualifier for the [[key]]. It should be specific enough to ensure uniqueness across all applications.\n * For example, all errors originating from a given package should use that package's full name as their scope.\n */\n readonly scope: string;\n /** Uniquely identifies a specific kind of [[ITwinError]] within the [[scope]]. */\n readonly key: string;\n}\n\n/** The interface that all exceptions thrown by iTwin.js libraries and applications should implement.\n * Specific kinds of `ITwinError`s are identified by an [[ITwinErrorId]] that allows programmers to identify errors when they are caught without relying\n * on specific class hierarchies, which is especially important when errors are marshalled across process boundaries.\n * You can extend `ITwinError` to add properties that provide programmers with additional context for a particular kind of error.\n * When catching errors, programmers can use [[isError]] to determine if the error is of a specific sub-type, and if so access the\n * additional properties.\n * Those additional properties will also be logged as metadata by [[Logger.logException]].\n * @beta\n */\nexport interface ITwinError extends Error {\n /** Uniquely identifies the kind of error. */\n readonly iTwinErrorId: ITwinErrorId;\n}\n\n/** @beta */\nexport namespace ITwinError {\n /** Instantiate a new `ITwinError` or subtype thereof.\n * @see [[ITwinError.throwError]] to conveniently instantiate and throw the error.\n */\n export function create<T extends ITwinError>(args: Omit<T, \"name\">): T {\n const err = new Error(args.message);\n Object.assign(err, args);\n err.name = args.iTwinErrorId.key; // helpful because this is used by `toString` for Error class\n return err as T;\n }\n\n /** Instantiate and immediately throw an `ITwinError`.\n * @see [[ITwinError.create]] to instantiate an error without throwing it.\n */\n export function throwError<T extends ITwinError>(args: Omit<T, \"name\">): never {\n throw create(args);\n }\n\n /**\n * Determine whether an error object was thrown by iTwin.js and has a specific scope and key.\n *\n * If the test succeeds, the type of `error` is coerced to `T`\n * @param error The error to ve verified.\n * @param scope value for `error.iTwinErrorId.scope`\n * @param key value for `error.iTwinErrorId.key`\n */\n export function isError<T extends ITwinError>(error: unknown, scope: string, key?: string): error is T {\n return JsonUtils.isObject(error) && \"iTwinErrorId\" in error && JsonUtils.isObject(error.iTwinErrorId)\n && error.iTwinErrorId.scope === scope && (undefined === key || error.iTwinErrorId.key === key);\n }\n}\n\n/** Standard status code.\n * This status code should be rarely used.\n * Prefer to throw an exception to indicate an error, rather than returning a special status code.\n * If a status code is to be returned, prefer to return a more specific error status type such as IModelStatus or DbResult.\n * @public\n */\nexport enum BentleyStatus {\n SUCCESS = 0x0000,\n ERROR = 0x8000,\n}\n\n/** Status codes that are used in conjunction with [[BentleyError]].\n * Error status codes are divided into separate ranges for different kinds of errors. All known ranges at least should be defined here, to avoid collisions.\n * @public\n */\nexport enum IModelStatus {\n IMODEL_ERROR_BASE = 0x10000,\n Success = 0,\n AlreadyLoaded = IMODEL_ERROR_BASE + 1,\n AlreadyOpen = IMODEL_ERROR_BASE + 2,\n BadArg = IMODEL_ERROR_BASE + 3,\n BadElement = IMODEL_ERROR_BASE + 4,\n BadModel = IMODEL_ERROR_BASE + 5,\n BadRequest = IMODEL_ERROR_BASE + 6,\n BadSchema = IMODEL_ERROR_BASE + 7,\n CannotUndo = IMODEL_ERROR_BASE + 8,\n CodeNotReserved = IMODEL_ERROR_BASE + 9,\n DeletionProhibited = IMODEL_ERROR_BASE + 10,\n DuplicateCode = IMODEL_ERROR_BASE + 11,\n DuplicateName = IMODEL_ERROR_BASE + 12,\n ElementBlockedChange = IMODEL_ERROR_BASE + 13,\n FileAlreadyExists = IMODEL_ERROR_BASE + 14,\n FileNotFound = IMODEL_ERROR_BASE + 15,\n FileNotLoaded = IMODEL_ERROR_BASE + 16,\n ForeignKeyConstraint = IMODEL_ERROR_BASE + 17,\n IdExists = IMODEL_ERROR_BASE + 18,\n InDynamicTransaction = IMODEL_ERROR_BASE + 19,\n InvalidCategory = IMODEL_ERROR_BASE + 20,\n InvalidCode = IMODEL_ERROR_BASE + 21,\n InvalidCodeSpec = IMODEL_ERROR_BASE + 22,\n InvalidId = IMODEL_ERROR_BASE + 23,\n InvalidName = IMODEL_ERROR_BASE + 24,\n InvalidParent = IMODEL_ERROR_BASE + 25,\n InvalidProfileVersion = IMODEL_ERROR_BASE + 26,\n IsCreatingChangeSet = IMODEL_ERROR_BASE + 27,\n LockNotHeld = IMODEL_ERROR_BASE + 28,\n Mismatch2d3d = IMODEL_ERROR_BASE + 29,\n MismatchGcs = IMODEL_ERROR_BASE + 30,\n MissingDomain = IMODEL_ERROR_BASE + 31,\n MissingHandler = IMODEL_ERROR_BASE + 32,\n MissingId = IMODEL_ERROR_BASE + 33,\n NoGeometry = IMODEL_ERROR_BASE + 34,\n NoMultiTxnOperation = IMODEL_ERROR_BASE + 35,\n NotEnabled = IMODEL_ERROR_BASE + 37,\n NotFound = IMODEL_ERROR_BASE + 38,\n NotOpen = IMODEL_ERROR_BASE + 39,\n NotOpenForWrite = IMODEL_ERROR_BASE + 40,\n NotSameUnitBase = IMODEL_ERROR_BASE + 41,\n NothingToRedo = IMODEL_ERROR_BASE + 42,\n NothingToUndo = IMODEL_ERROR_BASE + 43,\n ParentBlockedChange = IMODEL_ERROR_BASE + 44,\n ReadError = IMODEL_ERROR_BASE + 45,\n ReadOnly = IMODEL_ERROR_BASE + 46,\n ReadOnlyDomain = IMODEL_ERROR_BASE + 47,\n RepositoryManagerError = IMODEL_ERROR_BASE + 48,\n SQLiteError = IMODEL_ERROR_BASE + 49,\n TransactionActive = IMODEL_ERROR_BASE + 50,\n UnitsMissing = IMODEL_ERROR_BASE + 51,\n UnknownFormat = IMODEL_ERROR_BASE + 52,\n UpgradeFailed = IMODEL_ERROR_BASE + 53,\n ValidationFailed = IMODEL_ERROR_BASE + 54,\n VersionTooNew = IMODEL_ERROR_BASE + 55,\n VersionTooOld = IMODEL_ERROR_BASE + 56,\n ViewNotFound = IMODEL_ERROR_BASE + 57,\n WriteError = IMODEL_ERROR_BASE + 58,\n WrongClass = IMODEL_ERROR_BASE + 59,\n WrongIModel = IMODEL_ERROR_BASE + 60,\n WrongDomain = IMODEL_ERROR_BASE + 61,\n WrongElement = IMODEL_ERROR_BASE + 62,\n WrongHandler = IMODEL_ERROR_BASE + 63,\n WrongModel = IMODEL_ERROR_BASE + 64,\n ConstraintNotUnique = IMODEL_ERROR_BASE + 65,\n NoGeoLocation = IMODEL_ERROR_BASE + 66,\n ServerTimeout = IMODEL_ERROR_BASE + 67,\n NoContent = IMODEL_ERROR_BASE + 68,\n NotRegistered = IMODEL_ERROR_BASE + 69,\n FunctionNotFound = IMODEL_ERROR_BASE + 70,\n NoActiveCommand = IMODEL_ERROR_BASE + 71,\n Aborted = IMODEL_ERROR_BASE + 72,\n}\n\n/** Error statuses produced by various briefcase operations, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum BriefcaseStatus {\n BRIEFCASE_STATUS_BASE = 0x20000,\n CannotAcquire = BRIEFCASE_STATUS_BASE,\n CannotDownload = BRIEFCASE_STATUS_BASE + 1,\n CannotUpload = BRIEFCASE_STATUS_BASE + 2,\n CannotCopy = BRIEFCASE_STATUS_BASE + 3,\n CannotDelete = BRIEFCASE_STATUS_BASE + 4,\n VersionNotFound = BRIEFCASE_STATUS_BASE + 5,\n CannotApplyChanges = BRIEFCASE_STATUS_BASE + 6,\n DownloadCancelled = BRIEFCASE_STATUS_BASE + 7,\n ContainsDeletedChangeSets = BRIEFCASE_STATUS_BASE + 8,\n}\n\n/** RpcInterface status codes\n * @beta\n */\nexport enum RpcInterfaceStatus {\n Success = 0,\n RPC_INTERFACE_ERROR_BASE = 0x21000,\n /** The RpcInterface implemented by the server is incompatible with the interface requested by the client. */\n IncompatibleVersion = RPC_INTERFACE_ERROR_BASE,\n}\n\n/** Error statuses produced by various Changeset operations, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum ChangeSetStatus { // Note: Values must be kept in sync with ChangeSetStatus in DgnPlatform\n Success = 0,\n CHANGESET_ERROR_BASE = 0x16000,\n /** Error applying a change set when reversing or reinstating it */\n ApplyError = CHANGESET_ERROR_BASE + 1,\n /** Change tracking has not been enabled. The ChangeSet API mandates this. */\n ChangeTrackingNotEnabled = CHANGESET_ERROR_BASE + 2,\n /** Contents of the change stream are corrupted and does not match the ChangeSet */\n CorruptedChangeStream = CHANGESET_ERROR_BASE + 3,\n /** File containing the changes to the change set is not found */\n FileNotFound = CHANGESET_ERROR_BASE + 4,\n /** Error writing the contents of the change set to the backing change stream file */\n FileWriteError = CHANGESET_ERROR_BASE + 5,\n /** Cannot perform the operation since the Db has local changes */\n HasLocalChanges = CHANGESET_ERROR_BASE + 6,\n /** Cannot perform the operation since current transaction has uncommitted changes */\n HasUncommittedChanges = CHANGESET_ERROR_BASE + 7,\n /** Invalid ChangeSet Id */\n InvalidId = CHANGESET_ERROR_BASE + 8,\n /** Invalid version of the change set */\n InvalidVersion = CHANGESET_ERROR_BASE + 9,\n /** Cannot perform the operation since system is in the middle of a dynamic transaction */\n InDynamicTransaction = CHANGESET_ERROR_BASE + 10,\n /** Cannot perform operation since system is in the middle of a creating a change set */\n IsCreatingChangeSet = CHANGESET_ERROR_BASE + 11,\n /** Cannot perform operation since the system is not creating a change set */\n IsNotCreatingChangeSet = CHANGESET_ERROR_BASE + 12,\n /** Error propagating the changes after the merge */\n MergePropagationError = CHANGESET_ERROR_BASE + 13,\n /** No change sets to merge */\n NothingToMerge = CHANGESET_ERROR_BASE + 14,\n /** No transactions are available to create a change set */\n NoTransactions = CHANGESET_ERROR_BASE + 15,\n /** Parent change set of the Db does not match the parent id of the change set */\n ParentMismatch = CHANGESET_ERROR_BASE + 16,\n /** Error performing a SQLite operation on the Db */\n SQLiteError = CHANGESET_ERROR_BASE + 17,\n /** ChangeSet originated in a different Db */\n WrongDgnDb = CHANGESET_ERROR_BASE + 18,\n /** Could not open the DgnDb to merge change set */\n CouldNotOpenDgnDb = CHANGESET_ERROR_BASE + 19,\n /** Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */\n MergeSchemaChangesOnOpen = CHANGESET_ERROR_BASE + 20,\n /** Cannot reverse or reinstate schema changes. */\n ReverseOrReinstateSchemaChanges = CHANGESET_ERROR_BASE + 21,\n /** Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */\n ProcessSchemaChangesOnOpen = CHANGESET_ERROR_BASE + 22,\n /** Cannot merge changes into a Readonly DgnDb. */\n CannotMergeIntoReadonly = CHANGESET_ERROR_BASE + 23,\n /** Cannot merge changes into a Master DgnDb. */\n CannotMergeIntoMaster = CHANGESET_ERROR_BASE + 24,\n /** Cannot merge changes into a DgnDb that has reversed change sets. */\n CannotMergeIntoReversed = CHANGESET_ERROR_BASE + 25,\n /** ChangeSet(s) download was cancelled. */\n DownloadCancelled = CHANGESET_ERROR_BASE + 26,\n}\n\n/** Status from returned HTTP status code\n * @beta\n */\nexport enum HttpStatus {\n /** 2xx Success */\n Success = 0,\n /** 1xx Informational responses */\n Info = 0x17001,\n /** 3xx Redirection */\n Redirection = 0x17002,\n /** 4xx Client errors */\n ClientError = 0x17003,\n /** 5xx Server errors */\n ServerError = 0x17004,\n}\n\n/** Statuses produced by APIs that interact with iModelHub, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum IModelHubStatus {\n Success = 0,\n IMODELHUBERROR_BASE = 0x19000,\n IMODELHUBERROR_REQUESTERRORBASE = 0x19100,\n Unknown = IMODELHUBERROR_BASE + 1,\n MissingRequiredProperties = IMODELHUBERROR_BASE + 2,\n InvalidPropertiesValues = IMODELHUBERROR_BASE + 3,\n UserDoesNotHavePermission = IMODELHUBERROR_BASE + 4,\n UserDoesNotHaveAccess = IMODELHUBERROR_BASE + 5,\n InvalidBriefcase = IMODELHUBERROR_BASE + 6,\n BriefcaseDoesNotExist = IMODELHUBERROR_BASE + 7,\n BriefcaseDoesNotBelongToUser = IMODELHUBERROR_BASE + 8,\n AnotherUserPushing = IMODELHUBERROR_BASE + 9,\n ChangeSetAlreadyExists = IMODELHUBERROR_BASE + 10,\n ChangeSetDoesNotExist = IMODELHUBERROR_BASE + 11,\n FileIsNotUploaded = IMODELHUBERROR_BASE + 12,\n iModelIsNotInitialized = IMODELHUBERROR_BASE + 13,\n ChangeSetPointsToBadSeed = IMODELHUBERROR_BASE + 14,\n OperationFailed = IMODELHUBERROR_BASE + 15,\n PullIsRequired = IMODELHUBERROR_BASE + 16,\n MaximumNumberOfBriefcasesPerUser = IMODELHUBERROR_BASE + 17,\n MaximumNumberOfBriefcasesPerUserPerMinute = IMODELHUBERROR_BASE + 18,\n DatabaseTemporarilyLocked = IMODELHUBERROR_BASE + 19,\n iModelIsLocked = IMODELHUBERROR_BASE + 20,\n CodesExist = IMODELHUBERROR_BASE + 21,\n LocksExist = IMODELHUBERROR_BASE + 22,\n iModelAlreadyExists = IMODELHUBERROR_BASE + 23,\n iModelDoesNotExist = IMODELHUBERROR_BASE + 24,\n FileDoesNotExist = IMODELHUBERROR_BASE + 25,\n FileAlreadyExists = IMODELHUBERROR_BASE + 26,\n LockDoesNotExist = IMODELHUBERROR_BASE + 27,\n LockOwnedByAnotherBriefcase = IMODELHUBERROR_BASE + 28,\n CodeStateInvalid = IMODELHUBERROR_BASE + 29,\n CodeReservedByAnotherBriefcase = IMODELHUBERROR_BASE + 30,\n CodeDoesNotExist = IMODELHUBERROR_BASE + 31,\n EventTypeDoesNotExist = IMODELHUBERROR_BASE + 32,\n EventSubscriptionDoesNotExist = IMODELHUBERROR_BASE + 33,\n EventSubscriptionAlreadyExists = IMODELHUBERROR_BASE + 34,\n ITwinIdIsNotSpecified = IMODELHUBERROR_BASE + 35,\n FailedToGetITwinPermissions = IMODELHUBERROR_BASE + 36,\n FailedToGetITwinMembers = IMODELHUBERROR_BASE + 37,\n ChangeSetAlreadyHasVersion = IMODELHUBERROR_BASE + 38,\n VersionAlreadyExists = IMODELHUBERROR_BASE + 39,\n JobSchedulingFailed = IMODELHUBERROR_BASE + 40,\n ConflictsAggregate = IMODELHUBERROR_BASE + 41,\n FailedToGetITwinById = IMODELHUBERROR_BASE + 42,\n\n DatabaseOperationFailed = IMODELHUBERROR_BASE + 43,\n SeedFileInitializationFailed = IMODELHUBERROR_BASE + 44,\n\n FailedToGetAssetPermissions = IMODELHUBERROR_BASE + 45,\n FailedToGetAssetMembers = IMODELHUBERROR_BASE + 46,\n ITwinDoesNotExist = IMODELHUBERROR_BASE + 47,\n\n LockChunkDoesNotExist = IMODELHUBERROR_BASE + 49,\n\n CheckpointAlreadyExists = IMODELHUBERROR_BASE + 50,\n CheckpointDoesNotExist = IMODELHUBERROR_BASE + 51,\n\n // Errors that are returned for incorrect iModelHub request.\n UndefinedArgumentError = IMODELHUBERROR_REQUESTERRORBASE + 1,\n InvalidArgumentError = IMODELHUBERROR_REQUESTERRORBASE + 2,\n MissingDownloadUrlError = IMODELHUBERROR_REQUESTERRORBASE + 3,\n NotSupportedInBrowser = IMODELHUBERROR_REQUESTERRORBASE + 4,\n FileHandlerNotSet = IMODELHUBERROR_REQUESTERRORBASE + 5,\n FileNotFound = IMODELHUBERROR_REQUESTERRORBASE + 6,\n InitializationTimeout = IMODELHUBERROR_REQUESTERRORBASE + 7,\n}\n\n/** GeoServiceStatus errors\n * @public\n */\nexport enum GeoServiceStatus {\n Success = 0,\n GEOSERVICESTATUS_BASE = 0x24000,\n // Error mapped from 'IModelStatus'\n NoGeoLocation = IModelStatus.NoGeoLocation,\n // Following errors are mapped from 'GeoCoordStatus'\n OutOfUsefulRange = GEOSERVICESTATUS_BASE + 1,\n OutOfMathematicalDomain = GEOSERVICESTATUS_BASE + 2,\n NoDatumConverter = GEOSERVICESTATUS_BASE + 3,\n VerticalDatumConvertError = GEOSERVICESTATUS_BASE + 4,\n CSMapError = GEOSERVICESTATUS_BASE + 5,\n /**\n * @deprecated in 5.0. This status is never returned.\n */\n Pending = GEOSERVICESTATUS_BASE + 6,\n}\n\n/** Error status from various reality data operations\n * @alpha\n */\nexport enum RealityDataStatus {\n Success = 0,\n REALITYDATA_ERROR_BASE = 0x25000,\n InvalidData = REALITYDATA_ERROR_BASE + 1,\n}\n\n/** A function that returns a metadata object for a [[BentleyError]].\n * This is generally used for logging. However not every exception is logged, so use this if the metadata for an exception is expensive to create.\n * @public\n */\nexport type GetMetaDataFunction = () => object | undefined;\n\n/** Optional metadata attached to a [[BentleyError]]. May either be an object or a function that returns an object.\n * If this exception is logged and metadata is present, the metaData object is attached to the log entry via `JSON.stringify`\n * @public\n */\nexport type LoggingMetaData = GetMetaDataFunction | object | undefined;\n\n\ninterface ErrorProps {\n message: string;\n stack?: string;\n metadata?: object;\n}\n\n/**\n * An [[ITwinError]] that also supplies an `errorNumber`.\n * @note this interface exists *only* for legacy errors derived from `BentleyError`. The concept of \"error number\" is\n * problematic since it is impossible to enforce across the iTwin.js library, let alone across applications. New code should\n * use `ITwinError` and identify errors with strings instead.\n * @beta */\nexport interface LegacyITwinErrorWithNumber extends ITwinError {\n /** a number to identify the error. */\n readonly errorNumber: number;\n\n /** Logging metadata\n * @note exceptions should *not* include logging data. Logging should be done where exceptions are caught. This member exists\n * only for backwards compatibility.\n */\n loggingMetadata?: object;\n}\n\n/**\n * Base exception class for legacy iTwin.js errors.\n * For backwards compatibility only. Do not create new subclasses of BentleyError. Instead use [[ITwinError]].\n * @public\n */\nexport class BentleyError extends Error { // note: this class implements LegacyITwinErrorWithNumber but can't be declared as such because that interface is @beta.\n public static readonly iTwinErrorScope = \"bentley-error\";\n private readonly _metaData: LoggingMetaData;\n\n /**\n * @param errorNumber The a number that identifies of the problem.\n * @param message message that describes the problem (should not be localized).\n * @param metaData metaData about the exception.\n */\n public constructor(public errorNumber: number, message?: string, metaData?: LoggingMetaData) {\n super(message);\n this.errorNumber = errorNumber;\n this._metaData = metaData;\n this.name = this._initName();\n }\n\n /** supply the value for iTwinErrorId */\n public get iTwinErrorId() {\n return { scope: BentleyError.iTwinErrorScope, key: this.name };\n }\n /** value for logging metadata */\n public get loggingMetadata() { return this.getMetaData(); }\n\n /**\n * Determine if an error object implements the `LegacyITwinErrorWithNumber` interface.\n *\n * If the test succeeds, the type of `error` is coerced to `T`\n * @note this method does *not* test that the object is an `instanceOf BentleyError`.\n * @beta\n */\n public static isError<T extends LegacyITwinErrorWithNumber>(error: unknown, errorNumber?: number): error is T {\n return ITwinError.isError<LegacyITwinErrorWithNumber>(error, BentleyError.iTwinErrorScope) &&\n typeof error.errorNumber === \"number\" && (errorNumber === undefined || error.errorNumber === errorNumber);\n }\n\n /** Returns true if this BentleyError includes (optional) metadata. */\n public get hasMetaData(): boolean { return undefined !== this._metaData; }\n\n /** get the meta data associated with this BentleyError, if any. */\n public getMetaData(): object | undefined {\n return BentleyError.getMetaData(this._metaData);\n }\n\n /** get the metadata object associated with an ExceptionMetaData, if any. */\n public static getMetaData(metaData: LoggingMetaData): object | undefined {\n return (typeof metaData === \"function\") ? metaData() : metaData;\n }\n\n /** This function returns the name of each error status. Override this method to handle more error status codes. */\n protected _initName(): string {\n return BentleyError.getErrorKey(this.errorNumber);\n }\n\n /** This function returns the name of each error status. */\n public static getErrorKey(errorNumber: number) {\n switch (errorNumber) {\n case IModelStatus.AlreadyLoaded: return \"Already Loaded\";\n case IModelStatus.AlreadyOpen: return \"Already Open\";\n case IModelStatus.BadArg: return \"Bad Arg\";\n case IModelStatus.BadElement: return \"Bad Element\";\n case IModelStatus.BadModel: return \"Bad Model\";\n case IModelStatus.BadRequest: return \"Bad Request\";\n case IModelStatus.BadSchema: return \"Bad Schema\";\n case IModelStatus.CannotUndo: return \"Can not Undo\";\n case IModelStatus.CodeNotReserved: return \"Code Not Reserved\";\n case IModelStatus.DeletionProhibited: return \"Deletion Prohibited\";\n case IModelStatus.DuplicateCode: return \"Duplicate Code\";\n case IModelStatus.DuplicateName: return \"Duplicate Name\";\n case IModelStatus.ElementBlockedChange: return \"Element Blocked Change\";\n case IModelStatus.FileAlreadyExists: return \"File Already Exists\";\n case IModelStatus.FileNotFound: return \"File Not Found\";\n case IModelStatus.FileNotLoaded: return \"File Not Loaded\";\n case IModelStatus.ForeignKeyConstraint: return \"ForeignKey Constraint\";\n case IModelStatus.IdExists: return \"Id Exists\";\n case IModelStatus.InDynamicTransaction: return \"InDynamicTransaction\";\n case IModelStatus.InvalidCategory: return \"Invalid Category\";\n case IModelStatus.InvalidCode: return \"Invalid Code\";\n case IModelStatus.InvalidCodeSpec: return \"Invalid CodeSpec\";\n case IModelStatus.InvalidId: return \"Invalid Id\";\n case IModelStatus.InvalidName: return \"Invalid Name\";\n case IModelStatus.InvalidParent: return \"Invalid Parent\";\n case IModelStatus.InvalidProfileVersion: return \"Invalid Profile Version\";\n case IModelStatus.IsCreatingChangeSet: return \"IsCreatingChangeSet\";\n case IModelStatus.LockNotHeld: return \"Lock Not Held\";\n case IModelStatus.Mismatch2d3d: return \"Mismatch 2d3d\";\n case IModelStatus.MismatchGcs: return \"Mismatch Gcs\";\n case IModelStatus.MissingDomain: return \"Missing Domain\";\n case IModelStatus.MissingHandler: return \"Missing Handler\";\n case IModelStatus.MissingId: return \"Missing Id\";\n case IModelStatus.NoGeometry: return \"No Geometry\";\n case IModelStatus.NoMultiTxnOperation: return \"NoMultiTxnOperation\";\n case IModelStatus.NotEnabled: return \"Not Enabled\";\n case IModelStatus.NotFound: return \"Not Found\";\n case IModelStatus.NotOpen: return \"Not Open\";\n case IModelStatus.NotOpenForWrite: return \"Not Open For Write\";\n case IModelStatus.NotSameUnitBase: return \"Not Same Unit Base\";\n case IModelStatus.NothingToRedo: return \"Nothing To Redo\";\n case IModelStatus.NothingToUndo: return \"Nothing To Undo\";\n case IModelStatus.ParentBlockedChange: return \"Parent Blocked Change\";\n case IModelStatus.ReadError: return \"Read Error\";\n case IModelStatus.ReadOnly: return \"ReadOnly\";\n case IModelStatus.ReadOnlyDomain: return \"ReadOnlyDomain\";\n case IModelStatus.RepositoryManagerError: return \"RepositoryManagerError\";\n case IModelStatus.SQLiteError: return \"SQLiteError\";\n case IModelStatus.TransactionActive: return \"Transaction Active\";\n case IModelStatus.UnitsMissing: return \"Units Missing\";\n case IModelStatus.UnknownFormat: return \"Unknown Format\";\n case IModelStatus.UpgradeFailed: return \"Upgrade Failed\";\n case IModelStatus.ValidationFailed: return \"Validation Failed\";\n case IModelStatus.VersionTooNew: return \"Version Too New\";\n case IModelStatus.VersionTooOld: return \"Version Too Old\";\n case IModelStatus.ViewNotFound: return \"View Not Found\";\n case IModelStatus.WriteError: return \"Write Error\";\n case IModelStatus.WrongClass: return \"Wrong Class\";\n case IModelStatus.WrongIModel: return \"Wrong IModel\";\n case IModelStatus.WrongDomain: return \"Wrong Domain\";\n case IModelStatus.WrongElement: return \"Wrong Element\";\n case IModelStatus.WrongHandler: return \"Wrong Handler\";\n case IModelStatus.WrongModel: return \"Wrong Model\";\n case DbResult.BE_SQLITE_ERROR: return \"BE_SQLITE_ERROR\";\n case DbResult.BE_SQLITE_INTERNAL: return \"BE_SQLITE_INTERNAL\";\n case DbResult.BE_SQLITE_PERM: return \"BE_SQLITE_PERM\";\n case DbResult.BE_SQLITE_ABORT: return \"BE_SQLITE_ABORT\";\n case DbResult.BE_SQLITE_BUSY: return \"Db is busy\";\n case DbResult.BE_SQLITE_LOCKED: return \"Db is Locked\";\n case DbResult.BE_SQLITE_NOMEM: return \"BE_SQLITE_NOMEM\";\n case DbResult.BE_SQLITE_READONLY: return \"Readonly\";\n case DbResult.BE_SQLITE_INTERRUPT: return \"BE_SQLITE_INTERRUPT\";\n case DbResult.BE_SQLITE_IOERR: return \"BE_SQLITE_IOERR\";\n case DbResult.BE_SQLITE_CORRUPT: return \"BE_SQLITE_CORRUPT\";\n case DbResult.BE_SQLITE_NOTFOUND: return \"Not Found\";\n case DbResult.BE_SQLITE_FULL: return \"BE_SQLITE_FULL\";\n case DbResult.BE_SQLITE_CANTOPEN: return \"Can't open\";\n case DbResult.BE_SQLITE_PROTOCOL: return \"BE_SQLITE_PROTOCOL\";\n case DbResult.BE_SQLITE_EMPTY: return \"BE_SQLITE_EMPTY\";\n case DbResult.BE_SQLITE_SCHEMA: return \"BE_SQLITE_SCHEMA\";\n case DbResult.BE_SQLITE_TOOBIG: return \"BE_SQLITE_TOOBIG\";\n case DbResult.BE_SQLITE_MISMATCH: return \"BE_SQLITE_MISMATCH\";\n case DbResult.BE_SQLITE_MISUSE: return \"BE_SQLITE_MISUSE\";\n case DbResult.BE_SQLITE_NOLFS: return \"BE_SQLITE_NOLFS\";\n case DbResult.BE_SQLITE_AUTH: return \"BE_SQLITE_AUTH\";\n case DbResult.BE_SQLITE_FORMAT: return \"BE_SQLITE_FORMAT\";\n case DbResult.BE_SQLITE_RANGE: return \"BE_SQLITE_RANGE\";\n case DbResult.BE_SQLITE_NOTADB: return \"Not a Database\";\n case DbResult.BE_SQLITE_IOERR_READ: return \"BE_SQLITE_IOERR_READ\";\n case DbResult.BE_SQLITE_IOERR_SHORT_READ: return \"BE_SQLITE_IOERR_SHORT_READ\";\n case DbResult.BE_SQLITE_IOERR_WRITE: return \"BE_SQLITE_IOERR_WRITE\";\n case DbResult.BE_SQLITE_IOERR_FSYNC: return \"BE_SQLITE_IOERR_FSYNC\";\n case DbResult.BE_SQLITE_IOERR_DIR_FSYNC: return \"BE_SQLITE_IOERR_DIR_FSYNC\";\n case DbResult.BE_SQLITE_IOERR_TRUNCATE: return \"BE_SQLITE_IOERR_TRUNCATE\";\n case DbResult.BE_SQLITE_IOERR_FSTAT: return \"BE_SQLITE_IOERR_FSTAT\";\n case DbResult.BE_SQLITE_IOERR_UNLOCK: return \"BE_SQLITE_IOERR_UNLOCK\";\n case DbResult.BE_SQLITE_IOERR_RDLOCK: return \"BE_SQLITE_IOERR_RDLOCK\";\n case DbResult.BE_SQLITE_IOERR_DELETE: return \"BE_SQLITE_IOERR_DELETE\";\n case DbResult.BE_SQLITE_IOERR_BLOCKED: return \"BE_SQLITE_IOERR_BLOCKED\";\n case DbResult.BE_SQLITE_IOERR_NOMEM: return \"BE_SQLITE_IOERR_NOMEM\";\n case DbResult.BE_SQLITE_IOERR_ACCESS: return \"BE_SQLITE_IOERR_ACCESS\";\n case DbResult.BE_SQLITE_IOERR_CHECKRESERVEDLOCK: return \"BE_SQLITE_IOERR_CHECKRESERVEDLOCK\";\n case DbResult.BE_SQLITE_IOERR_LOCK: return \"BE_SQLITE_IOERR_LOCK\";\n case DbResult.BE_SQLITE_IOERR_CLOSE: return \"BE_SQLITE_IOERR_CLOSE\";\n case DbResult.BE_SQLITE_IOERR_DIR_CLOSE: return \"BE_SQLITE_IOERR_DIR_CLOSE\";\n case DbResult.BE_SQLITE_IOERR_SHMOPEN: return \"BE_SQLITE_IOERR_SHMOPEN\";\n case DbResult.BE_SQLITE_IOERR_SHMSIZE: return \"BE_SQLITE_IOERR_SHMSIZE\";\n case DbResult.BE_SQLITE_IOERR_SHMLOCK: return \"BE_SQLITE_IOERR_SHMLOCK\";\n case DbResult.BE_SQLITE_IOERR_SHMMAP: return \"BE_SQLITE_IOERR_SHMMAP\";\n case DbResult.BE_SQLITE_IOERR_SEEK: return \"BE_SQLITE_IOERR_SEEK\";\n case DbResult.BE_SQLITE_IOERR_DELETE_NOENT: return \"BE_SQLITE_IOERR_DELETE_NOENT\";\n\n case DbResult.BE_SQLITE_ERROR_DataTransformRequired: return \"Schema update require to transform data\";\n case DbResult.BE_SQLITE_ERROR_FileExists: return \"File Exists\";\n case DbResult.BE_SQLITE_ERROR_AlreadyOpen: return \"Already Open\";\n case DbResult.BE_SQLITE_ERROR_NoPropertyTable: return \"No Property Table\";\n case DbResult.BE_SQLITE_ERROR_FileNotFound: return \"File Not Found\";\n case DbResult.BE_SQLITE_ERROR_NoTxnActive: return \"No Txn Active\";\n case DbResult.BE_SQLITE_ERROR_BadDbProfile: return \"Bad Db Profile\";\n case DbResult.BE_SQLITE_ERROR_InvalidProfileVersion: return \"Invalid Profile Version\";\n case DbResult.BE_SQLITE_ERROR_ProfileUpgradeFailed: return \"Profile Upgrade Failed\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooOldForReadWrite: return \"Profile Too Old For ReadWrite\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooOld: return \"Profile Too Old\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooNewForReadWrite: return \"Profile Too New For ReadWrite\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooNew: return \"Profile Too New\";\n case DbResult.BE_SQLITE_ERROR_ChangeTrackError: return \"ChangeTrack Error\";\n case DbResult.BE_SQLITE_ERROR_InvalidChangeSetVersion: return \"Invalid ChangeSet Version\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRequired: return \"Schema Upgrade Required\";\n case DbResult.BE_SQLITE_ERROR_SchemaTooNew: return \"Schema Too New\";\n case DbResult.BE_SQLITE_ERROR_SchemaTooOld: return \"Schema Too Old\";\n case DbResult.BE_SQLITE_ERROR_SchemaLockFailed: return \"Schema Lock Failed\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeFailed: return \"Schema Upgrade Failed\";\n case DbResult.BE_SQLITE_ERROR_SchemaImportFailed: return \"Schema Import Failed\";\n case DbResult.BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes: return \"Could Not Acquire Locks Or Codes\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRecommended: return \"Recommended that the schemas found in the database be upgraded\";\n case DbResult.BE_SQLITE_LOCKED_SHAREDCACHE: return \"BE_SQLITE_LOCKED_SHAREDCACHE\";\n case DbResult.BE_SQLITE_BUSY_RECOVERY: return \"BE_SQLITE_BUSY_RECOVERY\";\n case DbResult.BE_SQLITE_CANTOPEN_NOTEMPDIR: return \"SQLite No Temp Dir\";\n case DbResult.BE_SQLITE_CANTOPEN_ISDIR: return \"BE_SQLITE_CANTOPEN_ISDIR\";\n case DbResult.BE_SQLITE_CANTOPEN_FULLPATH: return \"BE_SQLITE_CANTOPEN_FULLPATH\";\n case DbResult.BE_SQLITE_CORRUPT_VTAB: return \"BE_SQLITE_CORRUPT_VTAB\";\n case DbResult.BE_SQLITE_READONLY_RECOVERY: return \"BE_SQLITE_READONLY_RECOVERY\";\n case DbResult.BE_SQLITE_READONLY_CANTLOCK: return \"BE_SQLITE_READONLY_CANTLOCK\";\n case DbResult.BE_SQLITE_READONLY_ROLLBACK: return \"BE_SQLITE_READONLY_ROLLBACK\";\n case DbResult.BE_SQLITE_ABORT_ROLLBACK: return \"BE_SQLITE_ABORT_ROLLBACK\";\n case DbResult.BE_SQLITE_CONSTRAINT_CHECK: return \"BE_SQLITE_CONSTRAINT_CHECK\";\n case DbResult.BE_SQLITE_CONSTRAINT_COMMITHOOK: return \"CommitHook Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_FOREIGNKEY: return \"Foreign Key Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_FUNCTION: return \"Function Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_NOTNULL: return \"NotNull Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_PRIMARYKEY: return \"Primary Key Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_TRIGGER: return \"Trigger Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_UNIQUE: return \"Unique Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_VTAB: return \"VTable Constraint Error\";\n case BentleyStatus.ERROR: return \"Error\";\n case BriefcaseStatus.CannotAcquire: return \"CannotAcquire\";\n case BriefcaseStatus.CannotDownload: return \"CannotDownload\";\n case BriefcaseStatus.CannotCopy: return \"CannotCopy\";\n case BriefcaseStatus.CannotDelete: return \"CannotDelete\";\n case BriefcaseStatus.VersionNotFound: return \"VersionNotFound\";\n case BriefcaseStatus.DownloadCancelled: return \"DownloadCancelled\";\n case BriefcaseStatus.ContainsDeletedChangeSets: return \"ContainsDeletedChangeSets\";\n case RpcInterfaceStatus.IncompatibleVersion: return \"RpcInterfaceStatus.IncompatibleVersion\";\n case ChangeSetStatus.ApplyError: return \"Error applying a change set\";\n case ChangeSetStatus.ChangeTrackingNotEnabled: return \"Change tracking has not been enabled. The ChangeSet API mandates this\";\n case ChangeSetStatus.CorruptedChangeStream: return \"Contents of the change stream are corrupted and does not match the ChangeSet\";\n case ChangeSetStatus.FileNotFound: return \"File containing the changes was not found\";\n case ChangeSetStatus.FileWriteError: return \"Error writing the contents of the change set to the backing change stream file\";\n case ChangeSetStatus.HasLocalChanges: return \"Cannot perform the operation since the Db has local changes\";\n case ChangeSetStatus.HasUncommittedChanges: return \"Cannot perform the operation since current transaction has uncommitted changes\";\n case ChangeSetStatus.InvalidId: return \"Invalid ChangeSet Id\";\n case ChangeSetStatus.InvalidVersion: return \"Invalid version of the change set\";\n case ChangeSetStatus.InDynamicTransaction: return \"Cannot perform the operation since system is in the middle of a dynamic transaction\";\n case ChangeSetStatus.IsCreatingChangeSet: return \"Cannot perform operation since system is in the middle of a creating a change set\";\n case ChangeSetStatus.IsNotCreatingChangeSet: return \"Cannot perform operation since the system is not creating a change set\";\n case ChangeSetStatus.MergePropagationError: return \"Error propagating the changes after the merge\";\n case ChangeSetStatus.NothingToMerge: return \"No change sets to merge\";\n case ChangeSetStatus.NoTransactions: return \"No transactions are available to create a change set\";\n case ChangeSetStatus.ParentMismatch: return \"Parent change set of the Db does not match the parent id of the change set\";\n case ChangeSetStatus.SQLiteError: return \"Error performing a SQLite operation on the Db\";\n case ChangeSetStatus.WrongDgnDb: return \"ChangeSet originated in a different Db\";\n case ChangeSetStatus.CouldNotOpenDgnDb: return \"Could not open the DgnDb to merge change set\";\n case ChangeSetStatus.MergeSchemaChangesOnOpen: return \"Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened\";\n case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return \"Cannot reverse or reinstate schema changes.\";\n case ChangeSetStatus.ProcessSchemaChangesOnOpen: return \"Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened\";\n case ChangeSetStatus.CannotMergeIntoReadonly: return \"Cannot merge changes into a Readonly DgnDb\";\n case ChangeSetStatus.CannotMergeIntoMaster: return \"Cannot merge changes into a Master DgnDb\";\n case ChangeSetStatus.CannotMergeIntoReversed: return \"Cannot merge changes into a DgnDb that has reversed change sets\";\n case ChangeSetStatus.DownloadCancelled: return \"ChangeSet(s) download was cancelled.\";\n case RepositoryStatus.ServerUnavailable: return \"ServerUnavailable\";\n case RepositoryStatus.LockAlreadyHeld: return \"LockAlreadyHeld\";\n case RepositoryStatus.SyncError: return \"SyncError\";\n case RepositoryStatus.InvalidResponse: return \"InvalidResponse\";\n case RepositoryStatus.PendingTransactions: return \"PendingTransactions\";\n case RepositoryStatus.LockUsed: return \"LockUsed\";\n case RepositoryStatus.CannotCreateChangeSet: return \"CannotCreateChangeSet\";\n case RepositoryStatus.InvalidRequest: return \"InvalidRequest\";\n case RepositoryStatus.ChangeSetRequired: return \"ChangeSetRequired\";\n case RepositoryStatus.CodeUnavailable: return \"CodeUnavailable\";\n case RepositoryStatus.CodeNotReserved: return \"CodeNotReserved\";\n case RepositoryStatus.CodeUsed: return \"CodeUsed\";\n case RepositoryStatus.LockNotHeld: return \"LockNotHeld\";\n case RepositoryStatus.RepositoryIsLocked: return \"RepositoryIsLocked\";\n case RepositoryStatus.ChannelConstraintViolation: return \"ChannelConstraintViolation\";\n case HttpStatus.Info: return \"HTTP Info\";\n case HttpStatus.Redirection: return \"HTTP Redirection\";\n case HttpStatus.ClientError: return \"HTTP Client error\";\n case HttpStatus.ServerError: return \"HTTP Server error\";\n case IModelHubStatus.Unknown: return \"Unknown error\";\n case IModelHubStatus.MissingRequiredProperties: return \"Missing required properties\";\n case IModelHubStatus.InvalidPropertiesValues: return \"Invalid properties values\";\n case IModelHubStatus.UserDoesNotHavePermission: return \"User does not have permission\";\n case IModelHubStatus.UserDoesNotHaveAccess: return \"User does not have access\";\n case IModelHubStatus.InvalidBriefcase: return \"Invalid briefcase\";\n case IModelHubStatus.BriefcaseDoesNotExist: return \"Briefcase does not exist\";\n case IModelHubStatus.BriefcaseDoesNotBelongToUser: return \"Briefcase does not belong to user\";\n case IModelHubStatus.AnotherUserPushing: return \"Another user pushing\";\n case IModelHubStatus.ChangeSetAlreadyExists: return \"ChangeSet already exists\";\n case IModelHubStatus.ChangeSetDoesNotExist: return \"ChangeSet does not exist\";\n case IModelHubStatus.FileIsNotUploaded: return \"File is not uploaded\";\n case IModelHubStatus.iModelIsNotInitialized: return \"iModel is not initialized\";\n case IModelHubStatus.ChangeSetPointsToBadSeed: return \"ChangeSet points to a bad seed file\";\n case IModelHubStatus.OperationFailed: return \"iModelHub operation has failed\";\n case IModelHubStatus.PullIsRequired: return \"Pull is required\";\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return \"Limit of briefcases per user was reached\";\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return \"Limit of briefcases per user per minute was reached\";\n case IModelHubStatus.DatabaseTemporarilyLocked: return \"Database is temporarily locked\";\n case IModelHubStatus.iModelIsLocked: return \"iModel is locked\";\n case IModelHubStatus.CodesExist: return \"Code already exists\";\n case IModelHubStatus.LocksExist: return \"Lock already exists\";\n case IModelHubStatus.iModelAlreadyExists: return \"iModel already exists\";\n case IModelHubStatus.iModelDoesNotExist: return \"iModel does not exist\";\n case IModelHubStatus.LockDoesNotExist: return \"Lock does not exist\";\n case IModelHubStatus.LockChunkDoesNotExist: return \"Lock chunk does not exist\";\n case IModelHubStatus.LockOwnedByAnotherBriefcase: return \"Lock is owned by another briefcase\";\n case IModelHubStatus.CodeStateInvalid: return \"Code state is invalid\";\n case IModelHubStatus.CodeReservedByAnotherBriefcase: return \"Code is reserved by another briefcase\";\n case IModelHubStatus.CodeDoesNotExist: return \"Code does not exist\";\n case IModelHubStatus.FileDoesNotExist: return \"File does not exist\";\n case IModelHubStatus.FileAlreadyExists: return \"File already exists\";\n case IModelHubStatus.EventTypeDoesNotExist: return \"Event type does not exist\";\n case IModelHubStatus.EventSubscriptionDoesNotExist: return \"Event subscription does not exist\";\n case IModelHubStatus.EventSubscriptionAlreadyExists: return \"Event subscription already exists\";\n case IModelHubStatus.ITwinIdIsNotSpecified: return \"ITwin Id is not specified\";\n case IModelHubStatus.FailedToGetITwinPermissions: return \"Failed to get iTwin permissions\";\n case IModelHubStatus.FailedToGetITwinMembers: return \"Failed to get iTwin members\";\n case IModelHubStatus.FailedToGetAssetPermissions: return \"Failed to get asset permissions\";\n case IModelHubStatus.FailedToGetAssetMembers: return \"Failed to get asset members\";\n case IModelHubStatus.ChangeSetAlreadyHasVersion: return \"ChangeSet already has version\";\n case IModelHubStatus.VersionAlreadyExists: return \"Version already exists\";\n case IModelHubStatus.JobSchedulingFailed: return \"Failed to schedule a background job\";\n case IModelHubStatus.ConflictsAggregate: return \"Codes or locks are owned by another briefcase\";\n case IModelHubStatus.FailedToGetITwinById: return \"Failed to query iTwin by its id\";\n case IModelHubStatus.DatabaseOperationFailed: return \"Database operation has failed\";\n case IModelHubStatus.ITwinDoesNotExist: return \"ITwin does not exist\";\n case IModelHubStatus.UndefinedArgumentError: return \"Undefined argument\";\n case IModelHubStatus.InvalidArgumentError: return \"Invalid argument\";\n case IModelHubStatus.MissingDownloadUrlError: return \"Missing download url\";\n case IModelHubStatus.NotSupportedInBrowser: return \"Not supported in browser\";\n case IModelHubStatus.FileHandlerNotSet: return \"File handler is not set\";\n case IModelHubStatus.FileNotFound: return \"File not found\";\n case GeoServiceStatus.NoGeoLocation: return \"No GeoLocation\";\n case GeoServiceStatus.OutOfUsefulRange: return \"Out of useful range\";\n case GeoServiceStatus.OutOfMathematicalDomain: return \"Out of mathematical domain\";\n case GeoServiceStatus.NoDatumConverter: return \"No datum converter\";\n case GeoServiceStatus.VerticalDatumConvertError: return \"Vertical datum convert error\";\n case GeoServiceStatus.CSMapError: return \"CSMap error\";\n case GeoServiceStatus.Pending: return \"Pending\"; // eslint-disable-line @typescript-eslint/no-deprecated\n case RealityDataStatus.InvalidData: return \"Invalid or unknown data\";\n case DbResult.BE_SQLITE_OK:\n case DbResult.BE_SQLITE_ROW:\n case DbResult.BE_SQLITE_DONE:\n case BentleyStatus.SUCCESS:\n return \"Success\";\n\n default:\n return `Error (${errorNumber})`;\n }\n }\n\n /** Use run-time type checking to safely get a useful string summary of an unknown error value, or `\"\"` if none exists.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`\n * @public\n */\n public static getErrorMessage(error: unknown): string {\n if (typeof error === \"string\")\n return error;\n\n if (error instanceof Error)\n return error.toString();\n\n if (JsonUtils.isObject(error)) {\n if (typeof error.message === \"string\")\n return error.message;\n\n if (typeof error.msg === \"string\")\n return error.msg;\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n if (error.toString() !== \"[object Object]\")\n return error.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string\n }\n\n return \"\";\n }\n\n /** Use run-time type checking to safely get the call stack of an unknown error value, if possible.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`\n * @public\n */\n public static getErrorStack(error: unknown): string | undefined {\n if (JsonUtils.isObject(error) && typeof error.stack === \"string\")\n return error.stack;\n\n return undefined;\n }\n\n /** Use run-time type checking to safely get the metadata with an unknown error value, if possible.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof BentleyError`\n * @see [[BentleyError.getMetaData]]\n * @public\n */\n public static getErrorMetadata(error: unknown): object | undefined {\n if (JsonUtils.isObject(error) && typeof error.getMetaData === \"function\") {\n const metadata = error.getMetaData();\n if (typeof metadata === \"object\" && metadata !== null)\n return metadata;\n }\n\n return undefined;\n }\n\n /** Returns a new `ErrorProps` object representing an unknown error value. Useful for logging or wrapping/re-throwing caught errors.\n * @note Unlike `Error` objects (which lose messages and call stacks when serialized to JSON), objects\n * returned by this are plain old JavaScript objects, and can be easily logged/serialized to JSON.\n * @public\n */\n public static getErrorProps(error: unknown): ErrorProps {\n const serialized: ErrorProps = {\n message: BentleyError.getErrorMessage(error),\n };\n\n const stack = BentleyError.getErrorStack(error);\n if (stack)\n serialized.stack = stack;\n\n const metadata = BentleyError.getErrorMetadata(error);\n if (metadata)\n serialized.metadata = metadata;\n\n return serialized;\n }\n}\n\n"]}
1
+ {"version":3,"file":"BentleyError.js","sourceRoot":"","sources":["../../src/BentleyError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA4BxC,YAAY;AACZ,MAAM,KAAW,UAAU,CA8B1B;AA9BD,WAAiB,UAAU;IACzB;;OAEG;IACH,SAAgB,MAAM,CAAuB,IAAqB;QAChE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzB,GAAG,CAAC,IAAI,GAA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SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC9D,OAAO,KAAK,CAAC,KAAK,CAAC;QAErB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAC,KAAc;QAC3C,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;YACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI;gBACnD,OAAO,QAAQ,CAAC;QACpB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,KAAc;QACxC,MAAM,UAAU,GAAe;YAC7B,OAAO,EAAE,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC;SAC7C,CAAC;QAEF,MAAM,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,KAAK;YACP,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;QAE3B,MAAM,QAAQ,GAAG,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,QAAQ;YACV,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEjC,OAAO,UAAU,CAAC;IACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Errors\n */\n\nimport { DbResult } from \"./BeSQLite\";\nimport { RepositoryStatus } from \"./internal/RepositoryStatus\";\nimport { JsonUtils } from \"./JsonUtils\";\n\n/** Uniquely identifies a specific kind of [[ITwinError]].\n * @beta\n */\nexport interface ITwinErrorId {\n /** A \"namespace\" serving as a qualifier for the [[key]]. It should be specific enough to ensure uniqueness across all applications.\n * For example, all errors originating from a given package should use that package's full name as their scope.\n */\n readonly scope: string;\n /** Uniquely identifies a specific kind of [[ITwinError]] within the [[scope]]. */\n readonly key: string;\n}\n\n/** The interface that all exceptions thrown by iTwin.js libraries and applications should implement.\n * Specific kinds of `ITwinError`s are identified by an [[ITwinErrorId]] that allows programmers to identify errors when they are caught without relying\n * on specific class hierarchies, which is especially important when errors are marshalled across process boundaries.\n * You can extend `ITwinError` to add properties that provide programmers with additional context for a particular kind of error.\n * When catching errors, programmers can use [[isError]] to determine if the error is of a specific sub-type, and if so access the\n * additional properties.\n * Those additional properties will also be logged as metadata by [[Logger.logException]].\n * @beta\n */\nexport interface ITwinError extends Error {\n /** Uniquely identifies the kind of error. */\n readonly iTwinErrorId: ITwinErrorId;\n}\n\n/** @beta */\nexport namespace ITwinError {\n /** Instantiate a new `ITwinError` or subtype thereof.\n * @see [[ITwinError.throwError]] to conveniently instantiate and throw the error.\n */\n export function create<T extends ITwinError>(args: Omit<T, \"name\">): T {\n const err = new Error(args.message);\n Object.assign(err, args);\n err.name = args.iTwinErrorId.key; // helpful because this is used by `toString` for Error class\n return err as T;\n }\n\n /** Instantiate and immediately throw an `ITwinError`.\n * @see [[ITwinError.create]] to instantiate an error without throwing it.\n */\n export function throwError<T extends ITwinError>(args: Omit<T, \"name\">): never {\n throw create(args);\n }\n\n /**\n * Determine whether an error object was thrown by iTwin.js and has a specific scope and key.\n *\n * If the test succeeds, the type of `error` is coerced to `T`\n * @param error The error to ve verified.\n * @param scope value for `error.iTwinErrorId.scope`\n * @param key value for `error.iTwinErrorId.key`\n */\n export function isError<T extends ITwinError>(error: unknown, scope: string, key?: string): error is T {\n return JsonUtils.isObject(error) && \"iTwinErrorId\" in error && JsonUtils.isObject(error.iTwinErrorId)\n && error.iTwinErrorId.scope === scope && (undefined === key || error.iTwinErrorId.key === key);\n }\n}\n\n/** Standard status code.\n * This status code should be rarely used.\n * Prefer to throw an exception to indicate an error, rather than returning a special status code.\n * If a status code is to be returned, prefer to return a more specific error status type such as IModelStatus or DbResult.\n * @public\n */\nexport enum BentleyStatus {\n SUCCESS = 0x0000,\n ERROR = 0x8000,\n}\n\n/** Status codes that are used in conjunction with [[BentleyError]].\n * Error status codes are divided into separate ranges for different kinds of errors. All known ranges at least should be defined here, to avoid collisions.\n * @public\n */\nexport enum IModelStatus {\n IMODEL_ERROR_BASE = 0x10000,\n Success = 0,\n AlreadyLoaded = IMODEL_ERROR_BASE + 1,\n AlreadyOpen = IMODEL_ERROR_BASE + 2,\n BadArg = IMODEL_ERROR_BASE + 3,\n BadElement = IMODEL_ERROR_BASE + 4,\n BadModel = IMODEL_ERROR_BASE + 5,\n BadRequest = IMODEL_ERROR_BASE + 6,\n BadSchema = IMODEL_ERROR_BASE + 7,\n CannotUndo = IMODEL_ERROR_BASE + 8,\n CodeNotReserved = IMODEL_ERROR_BASE + 9,\n DeletionProhibited = IMODEL_ERROR_BASE + 10,\n DuplicateCode = IMODEL_ERROR_BASE + 11,\n DuplicateName = IMODEL_ERROR_BASE + 12,\n ElementBlockedChange = IMODEL_ERROR_BASE + 13,\n FileAlreadyExists = IMODEL_ERROR_BASE + 14,\n FileNotFound = IMODEL_ERROR_BASE + 15,\n FileNotLoaded = IMODEL_ERROR_BASE + 16,\n ForeignKeyConstraint = IMODEL_ERROR_BASE + 17,\n IdExists = IMODEL_ERROR_BASE + 18,\n InDynamicTransaction = IMODEL_ERROR_BASE + 19,\n InvalidCategory = IMODEL_ERROR_BASE + 20,\n InvalidCode = IMODEL_ERROR_BASE + 21,\n InvalidCodeSpec = IMODEL_ERROR_BASE + 22,\n InvalidId = IMODEL_ERROR_BASE + 23,\n InvalidName = IMODEL_ERROR_BASE + 24,\n InvalidParent = IMODEL_ERROR_BASE + 25,\n InvalidProfileVersion = IMODEL_ERROR_BASE + 26,\n IsCreatingChangeSet = IMODEL_ERROR_BASE + 27,\n LockNotHeld = IMODEL_ERROR_BASE + 28,\n Mismatch2d3d = IMODEL_ERROR_BASE + 29,\n MismatchGcs = IMODEL_ERROR_BASE + 30,\n MissingDomain = IMODEL_ERROR_BASE + 31,\n MissingHandler = IMODEL_ERROR_BASE + 32,\n MissingId = IMODEL_ERROR_BASE + 33,\n NoGeometry = IMODEL_ERROR_BASE + 34,\n NoMultiTxnOperation = IMODEL_ERROR_BASE + 35,\n NotEnabled = IMODEL_ERROR_BASE + 37,\n NotFound = IMODEL_ERROR_BASE + 38,\n NotOpen = IMODEL_ERROR_BASE + 39,\n NotOpenForWrite = IMODEL_ERROR_BASE + 40,\n NotSameUnitBase = IMODEL_ERROR_BASE + 41,\n NothingToRedo = IMODEL_ERROR_BASE + 42,\n NothingToUndo = IMODEL_ERROR_BASE + 43,\n ParentBlockedChange = IMODEL_ERROR_BASE + 44,\n ReadError = IMODEL_ERROR_BASE + 45,\n ReadOnly = IMODEL_ERROR_BASE + 46,\n ReadOnlyDomain = IMODEL_ERROR_BASE + 47,\n RepositoryManagerError = IMODEL_ERROR_BASE + 48,\n SQLiteError = IMODEL_ERROR_BASE + 49,\n TransactionActive = IMODEL_ERROR_BASE + 50,\n UnitsMissing = IMODEL_ERROR_BASE + 51,\n UnknownFormat = IMODEL_ERROR_BASE + 52,\n UpgradeFailed = IMODEL_ERROR_BASE + 53,\n ValidationFailed = IMODEL_ERROR_BASE + 54,\n VersionTooNew = IMODEL_ERROR_BASE + 55,\n VersionTooOld = IMODEL_ERROR_BASE + 56,\n ViewNotFound = IMODEL_ERROR_BASE + 57,\n WriteError = IMODEL_ERROR_BASE + 58,\n WrongClass = IMODEL_ERROR_BASE + 59,\n WrongIModel = IMODEL_ERROR_BASE + 60,\n WrongDomain = IMODEL_ERROR_BASE + 61,\n WrongElement = IMODEL_ERROR_BASE + 62,\n WrongHandler = IMODEL_ERROR_BASE + 63,\n WrongModel = IMODEL_ERROR_BASE + 64,\n ConstraintNotUnique = IMODEL_ERROR_BASE + 65,\n NoGeoLocation = IMODEL_ERROR_BASE + 66,\n ServerTimeout = IMODEL_ERROR_BASE + 67,\n NoContent = IMODEL_ERROR_BASE + 68,\n NotRegistered = IMODEL_ERROR_BASE + 69,\n FunctionNotFound = IMODEL_ERROR_BASE + 70,\n NoActiveCommand = IMODEL_ERROR_BASE + 71,\n Aborted = IMODEL_ERROR_BASE + 72,\n}\n\n/** Error statuses produced by various briefcase operations, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum BriefcaseStatus {\n BRIEFCASE_STATUS_BASE = 0x20000,\n CannotAcquire = BRIEFCASE_STATUS_BASE,\n CannotDownload = BRIEFCASE_STATUS_BASE + 1,\n CannotUpload = BRIEFCASE_STATUS_BASE + 2,\n CannotCopy = BRIEFCASE_STATUS_BASE + 3,\n CannotDelete = BRIEFCASE_STATUS_BASE + 4,\n VersionNotFound = BRIEFCASE_STATUS_BASE + 5,\n CannotApplyChanges = BRIEFCASE_STATUS_BASE + 6,\n DownloadCancelled = BRIEFCASE_STATUS_BASE + 7,\n ContainsDeletedChangeSets = BRIEFCASE_STATUS_BASE + 8,\n}\n\n/** RpcInterface status codes\n * @beta\n */\nexport enum RpcInterfaceStatus {\n Success = 0,\n RPC_INTERFACE_ERROR_BASE = 0x21000,\n /** The RpcInterface implemented by the server is incompatible with the interface requested by the client. */\n IncompatibleVersion = RPC_INTERFACE_ERROR_BASE,\n}\n\n/** Error statuses produced by various Changeset operations, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum ChangeSetStatus { // Note: Values must be kept in sync with ChangeSetStatus in DgnPlatform\n Success = 0,\n CHANGESET_ERROR_BASE = 0x16000,\n /** Error applying a change set when reversing or reinstating it */\n ApplyError = CHANGESET_ERROR_BASE + 1,\n /** Change tracking has not been enabled. The ChangeSet API mandates this. */\n ChangeTrackingNotEnabled = CHANGESET_ERROR_BASE + 2,\n /** Contents of the change stream are corrupted and does not match the ChangeSet */\n CorruptedChangeStream = CHANGESET_ERROR_BASE + 3,\n /** File containing the changes to the change set is not found */\n FileNotFound = CHANGESET_ERROR_BASE + 4,\n /** Error writing the contents of the change set to the backing change stream file */\n FileWriteError = CHANGESET_ERROR_BASE + 5,\n /** Cannot perform the operation since the Db has local changes */\n HasLocalChanges = CHANGESET_ERROR_BASE + 6,\n /** Cannot perform the operation since current transaction has uncommitted changes */\n HasUncommittedChanges = CHANGESET_ERROR_BASE + 7,\n /** Invalid ChangeSet Id */\n InvalidId = CHANGESET_ERROR_BASE + 8,\n /** Invalid version of the change set */\n InvalidVersion = CHANGESET_ERROR_BASE + 9,\n /** Cannot perform the operation since system is in the middle of a dynamic transaction */\n InDynamicTransaction = CHANGESET_ERROR_BASE + 10,\n /** Cannot perform operation since system is in the middle of a creating a change set */\n IsCreatingChangeSet = CHANGESET_ERROR_BASE + 11,\n /** Cannot perform operation since the system is not creating a change set */\n IsNotCreatingChangeSet = CHANGESET_ERROR_BASE + 12,\n /** Error propagating the changes after the merge */\n MergePropagationError = CHANGESET_ERROR_BASE + 13,\n /** No change sets to merge */\n NothingToMerge = CHANGESET_ERROR_BASE + 14,\n /** No transactions are available to create a change set */\n NoTransactions = CHANGESET_ERROR_BASE + 15,\n /** Parent change set of the Db does not match the parent id of the change set */\n ParentMismatch = CHANGESET_ERROR_BASE + 16,\n /** Error performing a SQLite operation on the Db */\n SQLiteError = CHANGESET_ERROR_BASE + 17,\n /** ChangeSet originated in a different Db */\n WrongDgnDb = CHANGESET_ERROR_BASE + 18,\n /** Could not open the DgnDb to merge change set */\n CouldNotOpenDgnDb = CHANGESET_ERROR_BASE + 19,\n /** Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */\n MergeSchemaChangesOnOpen = CHANGESET_ERROR_BASE + 20,\n /** Cannot reverse or reinstate schema changes. */\n ReverseOrReinstateSchemaChanges = CHANGESET_ERROR_BASE + 21,\n /** Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */\n ProcessSchemaChangesOnOpen = CHANGESET_ERROR_BASE + 22,\n /** Cannot merge changes into a Readonly DgnDb. */\n CannotMergeIntoReadonly = CHANGESET_ERROR_BASE + 23,\n /** Cannot merge changes into a Master DgnDb. */\n CannotMergeIntoMaster = CHANGESET_ERROR_BASE + 24,\n /** Cannot merge changes into a DgnDb that has reversed change sets. */\n CannotMergeIntoReversed = CHANGESET_ERROR_BASE + 25,\n /** ChangeSet(s) download was cancelled. */\n DownloadCancelled = CHANGESET_ERROR_BASE + 26,\n}\n\n/** Status from returned HTTP status code\n * @beta\n */\nexport enum HttpStatus {\n /** 2xx Success */\n Success = 0,\n /** 1xx Informational responses */\n Info = 0x17001,\n /** 3xx Redirection */\n Redirection = 0x17002,\n /** 4xx Client errors */\n ClientError = 0x17003,\n /** 5xx Server errors */\n ServerError = 0x17004,\n}\n\n/** Statuses produced by APIs that interact with iModelHub, typically encountered as the `errorNumber` of an [IModelError]($common).\n * @public\n */\nexport enum IModelHubStatus {\n Success = 0,\n IMODELHUBERROR_BASE = 0x19000,\n IMODELHUBERROR_REQUESTERRORBASE = 0x19100,\n Unknown = IMODELHUBERROR_BASE + 1,\n MissingRequiredProperties = IMODELHUBERROR_BASE + 2,\n InvalidPropertiesValues = IMODELHUBERROR_BASE + 3,\n UserDoesNotHavePermission = IMODELHUBERROR_BASE + 4,\n UserDoesNotHaveAccess = IMODELHUBERROR_BASE + 5,\n InvalidBriefcase = IMODELHUBERROR_BASE + 6,\n BriefcaseDoesNotExist = IMODELHUBERROR_BASE + 7,\n BriefcaseDoesNotBelongToUser = IMODELHUBERROR_BASE + 8,\n AnotherUserPushing = IMODELHUBERROR_BASE + 9,\n ChangeSetAlreadyExists = IMODELHUBERROR_BASE + 10,\n ChangeSetDoesNotExist = IMODELHUBERROR_BASE + 11,\n FileIsNotUploaded = IMODELHUBERROR_BASE + 12,\n iModelIsNotInitialized = IMODELHUBERROR_BASE + 13,\n ChangeSetPointsToBadSeed = IMODELHUBERROR_BASE + 14,\n OperationFailed = IMODELHUBERROR_BASE + 15,\n PullIsRequired = IMODELHUBERROR_BASE + 16,\n MaximumNumberOfBriefcasesPerUser = IMODELHUBERROR_BASE + 17,\n MaximumNumberOfBriefcasesPerUserPerMinute = IMODELHUBERROR_BASE + 18,\n DatabaseTemporarilyLocked = IMODELHUBERROR_BASE + 19,\n iModelIsLocked = IMODELHUBERROR_BASE + 20,\n CodesExist = IMODELHUBERROR_BASE + 21,\n LocksExist = IMODELHUBERROR_BASE + 22,\n iModelAlreadyExists = IMODELHUBERROR_BASE + 23,\n iModelDoesNotExist = IMODELHUBERROR_BASE + 24,\n FileDoesNotExist = IMODELHUBERROR_BASE + 25,\n FileAlreadyExists = IMODELHUBERROR_BASE + 26,\n LockDoesNotExist = IMODELHUBERROR_BASE + 27,\n LockOwnedByAnotherBriefcase = IMODELHUBERROR_BASE + 28,\n CodeStateInvalid = IMODELHUBERROR_BASE + 29,\n CodeReservedByAnotherBriefcase = IMODELHUBERROR_BASE + 30,\n CodeDoesNotExist = IMODELHUBERROR_BASE + 31,\n EventTypeDoesNotExist = IMODELHUBERROR_BASE + 32,\n EventSubscriptionDoesNotExist = IMODELHUBERROR_BASE + 33,\n EventSubscriptionAlreadyExists = IMODELHUBERROR_BASE + 34,\n ITwinIdIsNotSpecified = IMODELHUBERROR_BASE + 35,\n FailedToGetITwinPermissions = IMODELHUBERROR_BASE + 36,\n FailedToGetITwinMembers = IMODELHUBERROR_BASE + 37,\n ChangeSetAlreadyHasVersion = IMODELHUBERROR_BASE + 38,\n VersionAlreadyExists = IMODELHUBERROR_BASE + 39,\n JobSchedulingFailed = IMODELHUBERROR_BASE + 40,\n ConflictsAggregate = IMODELHUBERROR_BASE + 41,\n FailedToGetITwinById = IMODELHUBERROR_BASE + 42,\n\n DatabaseOperationFailed = IMODELHUBERROR_BASE + 43,\n SeedFileInitializationFailed = IMODELHUBERROR_BASE + 44,\n\n FailedToGetAssetPermissions = IMODELHUBERROR_BASE + 45,\n FailedToGetAssetMembers = IMODELHUBERROR_BASE + 46,\n ITwinDoesNotExist = IMODELHUBERROR_BASE + 47,\n\n LockChunkDoesNotExist = IMODELHUBERROR_BASE + 49,\n\n CheckpointAlreadyExists = IMODELHUBERROR_BASE + 50,\n CheckpointDoesNotExist = IMODELHUBERROR_BASE + 51,\n\n // Errors that are returned for incorrect iModelHub request.\n UndefinedArgumentError = IMODELHUBERROR_REQUESTERRORBASE + 1,\n InvalidArgumentError = IMODELHUBERROR_REQUESTERRORBASE + 2,\n MissingDownloadUrlError = IMODELHUBERROR_REQUESTERRORBASE + 3,\n NotSupportedInBrowser = IMODELHUBERROR_REQUESTERRORBASE + 4,\n FileHandlerNotSet = IMODELHUBERROR_REQUESTERRORBASE + 5,\n FileNotFound = IMODELHUBERROR_REQUESTERRORBASE + 6,\n InitializationTimeout = IMODELHUBERROR_REQUESTERRORBASE + 7,\n}\n\n/** GeoServiceStatus errors\n * @public\n */\nexport enum GeoServiceStatus {\n Success = 0,\n GEOSERVICESTATUS_BASE = 0x24000,\n // Error mapped from 'IModelStatus'\n NoGeoLocation = IModelStatus.NoGeoLocation,\n // Following errors are mapped from 'GeoCoordStatus'\n OutOfUsefulRange = GEOSERVICESTATUS_BASE + 1,\n OutOfMathematicalDomain = GEOSERVICESTATUS_BASE + 2,\n NoDatumConverter = GEOSERVICESTATUS_BASE + 3,\n VerticalDatumConvertError = GEOSERVICESTATUS_BASE + 4,\n CSMapError = GEOSERVICESTATUS_BASE + 5,\n /**\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. This status is never returned.\n */\n Pending = GEOSERVICESTATUS_BASE + 6,\n}\n\n/** Error status from various reality data operations\n * @alpha\n */\nexport enum RealityDataStatus {\n Success = 0,\n REALITYDATA_ERROR_BASE = 0x25000,\n InvalidData = REALITYDATA_ERROR_BASE + 1,\n}\n\n/** A function that returns a metadata object for a [[BentleyError]].\n * This is generally used for logging. However not every exception is logged, so use this if the metadata for an exception is expensive to create.\n * @public\n */\nexport type GetMetaDataFunction = () => object | undefined;\n\n/** Optional metadata attached to a [[BentleyError]]. May either be an object or a function that returns an object.\n * If this exception is logged and metadata is present, the metaData object is attached to the log entry via `JSON.stringify`\n * @public\n */\nexport type LoggingMetaData = GetMetaDataFunction | object | undefined;\n\n\ninterface ErrorProps {\n message: string;\n stack?: string;\n metadata?: object;\n}\n\n/**\n * An [[ITwinError]] that also supplies an `errorNumber`.\n * @note this interface exists *only* for legacy errors derived from `BentleyError`. The concept of \"error number\" is\n * problematic since it is impossible to enforce across the iTwin.js library, let alone across applications. New code should\n * use `ITwinError` and identify errors with strings instead.\n * @beta */\nexport interface LegacyITwinErrorWithNumber extends ITwinError {\n /** a number to identify the error. */\n readonly errorNumber: number;\n\n /** Logging metadata\n * @note exceptions should *not* include logging data. Logging should be done where exceptions are caught. This member exists\n * only for backwards compatibility.\n */\n loggingMetadata?: object;\n}\n\n/**\n * Base exception class for legacy iTwin.js errors.\n * For backwards compatibility only. Do not create new subclasses of BentleyError. Instead use [[ITwinError]].\n * @public\n */\nexport class BentleyError extends Error { // note: this class implements LegacyITwinErrorWithNumber but can't be declared as such because that interface is @beta.\n public static readonly iTwinErrorScope = \"bentley-error\";\n private readonly _metaData: LoggingMetaData;\n\n /**\n * @param errorNumber The a number that identifies of the problem.\n * @param message message that describes the problem (should not be localized).\n * @param metaData metaData about the exception.\n */\n public constructor(public errorNumber: number, message?: string, metaData?: LoggingMetaData) {\n super(message);\n this.errorNumber = errorNumber;\n this._metaData = metaData;\n this.name = this._initName();\n }\n\n /** supply the value for iTwinErrorId */\n public get iTwinErrorId() {\n return { scope: BentleyError.iTwinErrorScope, key: this.name };\n }\n /** value for logging metadata */\n public get loggingMetadata() { return this.getMetaData(); }\n\n /**\n * Determine if an error object implements the `LegacyITwinErrorWithNumber` interface.\n *\n * If the test succeeds, the type of `error` is coerced to `T`\n * @note this method does *not* test that the object is an `instanceOf BentleyError`.\n * @beta\n */\n public static isError<T extends LegacyITwinErrorWithNumber>(error: unknown, errorNumber?: number): error is T {\n return ITwinError.isError<LegacyITwinErrorWithNumber>(error, BentleyError.iTwinErrorScope) &&\n typeof error.errorNumber === \"number\" && (errorNumber === undefined || error.errorNumber === errorNumber);\n }\n\n /** Returns true if this BentleyError includes (optional) metadata. */\n public get hasMetaData(): boolean { return undefined !== this._metaData; }\n\n /** get the meta data associated with this BentleyError, if any. */\n public getMetaData(): object | undefined {\n return BentleyError.getMetaData(this._metaData);\n }\n\n /** get the metadata object associated with an ExceptionMetaData, if any. */\n public static getMetaData(metaData: LoggingMetaData): object | undefined {\n return (typeof metaData === \"function\") ? metaData() : metaData;\n }\n\n /** This function returns the name of each error status. Override this method to handle more error status codes. */\n protected _initName(): string {\n return BentleyError.getErrorKey(this.errorNumber);\n }\n\n /** This function returns the name of each error status. */\n public static getErrorKey(errorNumber: number) {\n switch (errorNumber) {\n case IModelStatus.AlreadyLoaded: return \"Already Loaded\";\n case IModelStatus.AlreadyOpen: return \"Already Open\";\n case IModelStatus.BadArg: return \"Bad Arg\";\n case IModelStatus.BadElement: return \"Bad Element\";\n case IModelStatus.BadModel: return \"Bad Model\";\n case IModelStatus.BadRequest: return \"Bad Request\";\n case IModelStatus.BadSchema: return \"Bad Schema\";\n case IModelStatus.CannotUndo: return \"Can not Undo\";\n case IModelStatus.CodeNotReserved: return \"Code Not Reserved\";\n case IModelStatus.DeletionProhibited: return \"Deletion Prohibited\";\n case IModelStatus.DuplicateCode: return \"Duplicate Code\";\n case IModelStatus.DuplicateName: return \"Duplicate Name\";\n case IModelStatus.ElementBlockedChange: return \"Element Blocked Change\";\n case IModelStatus.FileAlreadyExists: return \"File Already Exists\";\n case IModelStatus.FileNotFound: return \"File Not Found\";\n case IModelStatus.FileNotLoaded: return \"File Not Loaded\";\n case IModelStatus.ForeignKeyConstraint: return \"ForeignKey Constraint\";\n case IModelStatus.IdExists: return \"Id Exists\";\n case IModelStatus.InDynamicTransaction: return \"InDynamicTransaction\";\n case IModelStatus.InvalidCategory: return \"Invalid Category\";\n case IModelStatus.InvalidCode: return \"Invalid Code\";\n case IModelStatus.InvalidCodeSpec: return \"Invalid CodeSpec\";\n case IModelStatus.InvalidId: return \"Invalid Id\";\n case IModelStatus.InvalidName: return \"Invalid Name\";\n case IModelStatus.InvalidParent: return \"Invalid Parent\";\n case IModelStatus.InvalidProfileVersion: return \"Invalid Profile Version\";\n case IModelStatus.IsCreatingChangeSet: return \"IsCreatingChangeSet\";\n case IModelStatus.LockNotHeld: return \"Lock Not Held\";\n case IModelStatus.Mismatch2d3d: return \"Mismatch 2d3d\";\n case IModelStatus.MismatchGcs: return \"Mismatch Gcs\";\n case IModelStatus.MissingDomain: return \"Missing Domain\";\n case IModelStatus.MissingHandler: return \"Missing Handler\";\n case IModelStatus.MissingId: return \"Missing Id\";\n case IModelStatus.NoGeometry: return \"No Geometry\";\n case IModelStatus.NoMultiTxnOperation: return \"NoMultiTxnOperation\";\n case IModelStatus.NotEnabled: return \"Not Enabled\";\n case IModelStatus.NotFound: return \"Not Found\";\n case IModelStatus.NotOpen: return \"Not Open\";\n case IModelStatus.NotOpenForWrite: return \"Not Open For Write\";\n case IModelStatus.NotSameUnitBase: return \"Not Same Unit Base\";\n case IModelStatus.NothingToRedo: return \"Nothing To Redo\";\n case IModelStatus.NothingToUndo: return \"Nothing To Undo\";\n case IModelStatus.ParentBlockedChange: return \"Parent Blocked Change\";\n case IModelStatus.ReadError: return \"Read Error\";\n case IModelStatus.ReadOnly: return \"ReadOnly\";\n case IModelStatus.ReadOnlyDomain: return \"ReadOnlyDomain\";\n case IModelStatus.RepositoryManagerError: return \"RepositoryManagerError\";\n case IModelStatus.SQLiteError: return \"SQLiteError\";\n case IModelStatus.TransactionActive: return \"Transaction Active\";\n case IModelStatus.UnitsMissing: return \"Units Missing\";\n case IModelStatus.UnknownFormat: return \"Unknown Format\";\n case IModelStatus.UpgradeFailed: return \"Upgrade Failed\";\n case IModelStatus.ValidationFailed: return \"Validation Failed\";\n case IModelStatus.VersionTooNew: return \"Version Too New\";\n case IModelStatus.VersionTooOld: return \"Version Too Old\";\n case IModelStatus.ViewNotFound: return \"View Not Found\";\n case IModelStatus.WriteError: return \"Write Error\";\n case IModelStatus.WrongClass: return \"Wrong Class\";\n case IModelStatus.WrongIModel: return \"Wrong IModel\";\n case IModelStatus.WrongDomain: return \"Wrong Domain\";\n case IModelStatus.WrongElement: return \"Wrong Element\";\n case IModelStatus.WrongHandler: return \"Wrong Handler\";\n case IModelStatus.WrongModel: return \"Wrong Model\";\n case DbResult.BE_SQLITE_ERROR: return \"BE_SQLITE_ERROR\";\n case DbResult.BE_SQLITE_INTERNAL: return \"BE_SQLITE_INTERNAL\";\n case DbResult.BE_SQLITE_PERM: return \"BE_SQLITE_PERM\";\n case DbResult.BE_SQLITE_ABORT: return \"BE_SQLITE_ABORT\";\n case DbResult.BE_SQLITE_BUSY: return \"Db is busy\";\n case DbResult.BE_SQLITE_LOCKED: return \"Db is Locked\";\n case DbResult.BE_SQLITE_NOMEM: return \"BE_SQLITE_NOMEM\";\n case DbResult.BE_SQLITE_READONLY: return \"Readonly\";\n case DbResult.BE_SQLITE_INTERRUPT: return \"BE_SQLITE_INTERRUPT\";\n case DbResult.BE_SQLITE_IOERR: return \"BE_SQLITE_IOERR\";\n case DbResult.BE_SQLITE_CORRUPT: return \"BE_SQLITE_CORRUPT\";\n case DbResult.BE_SQLITE_NOTFOUND: return \"Not Found\";\n case DbResult.BE_SQLITE_FULL: return \"BE_SQLITE_FULL\";\n case DbResult.BE_SQLITE_CANTOPEN: return \"Can't open\";\n case DbResult.BE_SQLITE_PROTOCOL: return \"BE_SQLITE_PROTOCOL\";\n case DbResult.BE_SQLITE_EMPTY: return \"BE_SQLITE_EMPTY\";\n case DbResult.BE_SQLITE_SCHEMA: return \"BE_SQLITE_SCHEMA\";\n case DbResult.BE_SQLITE_TOOBIG: return \"BE_SQLITE_TOOBIG\";\n case DbResult.BE_SQLITE_MISMATCH: return \"BE_SQLITE_MISMATCH\";\n case DbResult.BE_SQLITE_MISUSE: return \"BE_SQLITE_MISUSE\";\n case DbResult.BE_SQLITE_NOLFS: return \"BE_SQLITE_NOLFS\";\n case DbResult.BE_SQLITE_AUTH: return \"BE_SQLITE_AUTH\";\n case DbResult.BE_SQLITE_FORMAT: return \"BE_SQLITE_FORMAT\";\n case DbResult.BE_SQLITE_RANGE: return \"BE_SQLITE_RANGE\";\n case DbResult.BE_SQLITE_NOTADB: return \"Not a Database\";\n case DbResult.BE_SQLITE_IOERR_READ: return \"BE_SQLITE_IOERR_READ\";\n case DbResult.BE_SQLITE_IOERR_SHORT_READ: return \"BE_SQLITE_IOERR_SHORT_READ\";\n case DbResult.BE_SQLITE_IOERR_WRITE: return \"BE_SQLITE_IOERR_WRITE\";\n case DbResult.BE_SQLITE_IOERR_FSYNC: return \"BE_SQLITE_IOERR_FSYNC\";\n case DbResult.BE_SQLITE_IOERR_DIR_FSYNC: return \"BE_SQLITE_IOERR_DIR_FSYNC\";\n case DbResult.BE_SQLITE_IOERR_TRUNCATE: return \"BE_SQLITE_IOERR_TRUNCATE\";\n case DbResult.BE_SQLITE_IOERR_FSTAT: return \"BE_SQLITE_IOERR_FSTAT\";\n case DbResult.BE_SQLITE_IOERR_UNLOCK: return \"BE_SQLITE_IOERR_UNLOCK\";\n case DbResult.BE_SQLITE_IOERR_RDLOCK: return \"BE_SQLITE_IOERR_RDLOCK\";\n case DbResult.BE_SQLITE_IOERR_DELETE: return \"BE_SQLITE_IOERR_DELETE\";\n case DbResult.BE_SQLITE_IOERR_BLOCKED: return \"BE_SQLITE_IOERR_BLOCKED\";\n case DbResult.BE_SQLITE_IOERR_NOMEM: return \"BE_SQLITE_IOERR_NOMEM\";\n case DbResult.BE_SQLITE_IOERR_ACCESS: return \"BE_SQLITE_IOERR_ACCESS\";\n case DbResult.BE_SQLITE_IOERR_CHECKRESERVEDLOCK: return \"BE_SQLITE_IOERR_CHECKRESERVEDLOCK\";\n case DbResult.BE_SQLITE_IOERR_LOCK: return \"BE_SQLITE_IOERR_LOCK\";\n case DbResult.BE_SQLITE_IOERR_CLOSE: return \"BE_SQLITE_IOERR_CLOSE\";\n case DbResult.BE_SQLITE_IOERR_DIR_CLOSE: return \"BE_SQLITE_IOERR_DIR_CLOSE\";\n case DbResult.BE_SQLITE_IOERR_SHMOPEN: return \"BE_SQLITE_IOERR_SHMOPEN\";\n case DbResult.BE_SQLITE_IOERR_SHMSIZE: return \"BE_SQLITE_IOERR_SHMSIZE\";\n case DbResult.BE_SQLITE_IOERR_SHMLOCK: return \"BE_SQLITE_IOERR_SHMLOCK\";\n case DbResult.BE_SQLITE_IOERR_SHMMAP: return \"BE_SQLITE_IOERR_SHMMAP\";\n case DbResult.BE_SQLITE_IOERR_SEEK: return \"BE_SQLITE_IOERR_SEEK\";\n case DbResult.BE_SQLITE_IOERR_DELETE_NOENT: return \"BE_SQLITE_IOERR_DELETE_NOENT\";\n\n case DbResult.BE_SQLITE_ERROR_DataTransformRequired: return \"Schema update require to transform data\";\n case DbResult.BE_SQLITE_ERROR_FileExists: return \"File Exists\";\n case DbResult.BE_SQLITE_ERROR_AlreadyOpen: return \"Already Open\";\n case DbResult.BE_SQLITE_ERROR_NoPropertyTable: return \"No Property Table\";\n case DbResult.BE_SQLITE_ERROR_FileNotFound: return \"File Not Found\";\n case DbResult.BE_SQLITE_ERROR_NoTxnActive: return \"No Txn Active\";\n case DbResult.BE_SQLITE_ERROR_BadDbProfile: return \"Bad Db Profile\";\n case DbResult.BE_SQLITE_ERROR_InvalidProfileVersion: return \"Invalid Profile Version\";\n case DbResult.BE_SQLITE_ERROR_ProfileUpgradeFailed: return \"Profile Upgrade Failed\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooOldForReadWrite: return \"Profile Too Old For ReadWrite\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooOld: return \"Profile Too Old\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooNewForReadWrite: return \"Profile Too New For ReadWrite\";\n case DbResult.BE_SQLITE_ERROR_ProfileTooNew: return \"Profile Too New\";\n case DbResult.BE_SQLITE_ERROR_ChangeTrackError: return \"ChangeTrack Error\";\n case DbResult.BE_SQLITE_ERROR_InvalidChangeSetVersion: return \"Invalid ChangeSet Version\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRequired: return \"Schema Upgrade Required\";\n case DbResult.BE_SQLITE_ERROR_SchemaTooNew: return \"Schema Too New\";\n case DbResult.BE_SQLITE_ERROR_SchemaTooOld: return \"Schema Too Old\";\n case DbResult.BE_SQLITE_ERROR_SchemaLockFailed: return \"Schema Lock Failed\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeFailed: return \"Schema Upgrade Failed\";\n case DbResult.BE_SQLITE_ERROR_SchemaImportFailed: return \"Schema Import Failed\";\n case DbResult.BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes: return \"Could Not Acquire Locks Or Codes\";\n case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRecommended: return \"Recommended that the schemas found in the database be upgraded\";\n case DbResult.BE_SQLITE_LOCKED_SHAREDCACHE: return \"BE_SQLITE_LOCKED_SHAREDCACHE\";\n case DbResult.BE_SQLITE_BUSY_RECOVERY: return \"BE_SQLITE_BUSY_RECOVERY\";\n case DbResult.BE_SQLITE_CANTOPEN_NOTEMPDIR: return \"SQLite No Temp Dir\";\n case DbResult.BE_SQLITE_CANTOPEN_ISDIR: return \"BE_SQLITE_CANTOPEN_ISDIR\";\n case DbResult.BE_SQLITE_CANTOPEN_FULLPATH: return \"BE_SQLITE_CANTOPEN_FULLPATH\";\n case DbResult.BE_SQLITE_CORRUPT_VTAB: return \"BE_SQLITE_CORRUPT_VTAB\";\n case DbResult.BE_SQLITE_READONLY_RECOVERY: return \"BE_SQLITE_READONLY_RECOVERY\";\n case DbResult.BE_SQLITE_READONLY_CANTLOCK: return \"BE_SQLITE_READONLY_CANTLOCK\";\n case DbResult.BE_SQLITE_READONLY_ROLLBACK: return \"BE_SQLITE_READONLY_ROLLBACK\";\n case DbResult.BE_SQLITE_ABORT_ROLLBACK: return \"BE_SQLITE_ABORT_ROLLBACK\";\n case DbResult.BE_SQLITE_CONSTRAINT_CHECK: return \"BE_SQLITE_CONSTRAINT_CHECK\";\n case DbResult.BE_SQLITE_CONSTRAINT_COMMITHOOK: return \"CommitHook Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_FOREIGNKEY: return \"Foreign Key Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_FUNCTION: return \"Function Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_NOTNULL: return \"NotNull Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_PRIMARYKEY: return \"Primary Key Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_TRIGGER: return \"Trigger Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_UNIQUE: return \"Unique Constraint Error\";\n case DbResult.BE_SQLITE_CONSTRAINT_VTAB: return \"VTable Constraint Error\";\n case BentleyStatus.ERROR: return \"Error\";\n case BriefcaseStatus.CannotAcquire: return \"CannotAcquire\";\n case BriefcaseStatus.CannotDownload: return \"CannotDownload\";\n case BriefcaseStatus.CannotCopy: return \"CannotCopy\";\n case BriefcaseStatus.CannotDelete: return \"CannotDelete\";\n case BriefcaseStatus.VersionNotFound: return \"VersionNotFound\";\n case BriefcaseStatus.DownloadCancelled: return \"DownloadCancelled\";\n case BriefcaseStatus.ContainsDeletedChangeSets: return \"ContainsDeletedChangeSets\";\n case RpcInterfaceStatus.IncompatibleVersion: return \"RpcInterfaceStatus.IncompatibleVersion\";\n case ChangeSetStatus.ApplyError: return \"Error applying a change set\";\n case ChangeSetStatus.ChangeTrackingNotEnabled: return \"Change tracking has not been enabled. The ChangeSet API mandates this\";\n case ChangeSetStatus.CorruptedChangeStream: return \"Contents of the change stream are corrupted and does not match the ChangeSet\";\n case ChangeSetStatus.FileNotFound: return \"File containing the changes was not found\";\n case ChangeSetStatus.FileWriteError: return \"Error writing the contents of the change set to the backing change stream file\";\n case ChangeSetStatus.HasLocalChanges: return \"Cannot perform the operation since the Db has local changes\";\n case ChangeSetStatus.HasUncommittedChanges: return \"Cannot perform the operation since current transaction has uncommitted changes\";\n case ChangeSetStatus.InvalidId: return \"Invalid ChangeSet Id\";\n case ChangeSetStatus.InvalidVersion: return \"Invalid version of the change set\";\n case ChangeSetStatus.InDynamicTransaction: return \"Cannot perform the operation since system is in the middle of a dynamic transaction\";\n case ChangeSetStatus.IsCreatingChangeSet: return \"Cannot perform operation since system is in the middle of a creating a change set\";\n case ChangeSetStatus.IsNotCreatingChangeSet: return \"Cannot perform operation since the system is not creating a change set\";\n case ChangeSetStatus.MergePropagationError: return \"Error propagating the changes after the merge\";\n case ChangeSetStatus.NothingToMerge: return \"No change sets to merge\";\n case ChangeSetStatus.NoTransactions: return \"No transactions are available to create a change set\";\n case ChangeSetStatus.ParentMismatch: return \"Parent change set of the Db does not match the parent id of the change set\";\n case ChangeSetStatus.SQLiteError: return \"Error performing a SQLite operation on the Db\";\n case ChangeSetStatus.WrongDgnDb: return \"ChangeSet originated in a different Db\";\n case ChangeSetStatus.CouldNotOpenDgnDb: return \"Could not open the DgnDb to merge change set\";\n case ChangeSetStatus.MergeSchemaChangesOnOpen: return \"Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened\";\n case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return \"Cannot reverse or reinstate schema changes.\";\n case ChangeSetStatus.ProcessSchemaChangesOnOpen: return \"Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened\";\n case ChangeSetStatus.CannotMergeIntoReadonly: return \"Cannot merge changes into a Readonly DgnDb\";\n case ChangeSetStatus.CannotMergeIntoMaster: return \"Cannot merge changes into a Master DgnDb\";\n case ChangeSetStatus.CannotMergeIntoReversed: return \"Cannot merge changes into a DgnDb that has reversed change sets\";\n case ChangeSetStatus.DownloadCancelled: return \"ChangeSet(s) download was cancelled.\";\n case RepositoryStatus.ServerUnavailable: return \"ServerUnavailable\";\n case RepositoryStatus.LockAlreadyHeld: return \"LockAlreadyHeld\";\n case RepositoryStatus.SyncError: return \"SyncError\";\n case RepositoryStatus.InvalidResponse: return \"InvalidResponse\";\n case RepositoryStatus.PendingTransactions: return \"PendingTransactions\";\n case RepositoryStatus.LockUsed: return \"LockUsed\";\n case RepositoryStatus.CannotCreateChangeSet: return \"CannotCreateChangeSet\";\n case RepositoryStatus.InvalidRequest: return \"InvalidRequest\";\n case RepositoryStatus.ChangeSetRequired: return \"ChangeSetRequired\";\n case RepositoryStatus.CodeUnavailable: return \"CodeUnavailable\";\n case RepositoryStatus.CodeNotReserved: return \"CodeNotReserved\";\n case RepositoryStatus.CodeUsed: return \"CodeUsed\";\n case RepositoryStatus.LockNotHeld: return \"LockNotHeld\";\n case RepositoryStatus.RepositoryIsLocked: return \"RepositoryIsLocked\";\n case RepositoryStatus.ChannelConstraintViolation: return \"ChannelConstraintViolation\";\n case HttpStatus.Info: return \"HTTP Info\";\n case HttpStatus.Redirection: return \"HTTP Redirection\";\n case HttpStatus.ClientError: return \"HTTP Client error\";\n case HttpStatus.ServerError: return \"HTTP Server error\";\n case IModelHubStatus.Unknown: return \"Unknown error\";\n case IModelHubStatus.MissingRequiredProperties: return \"Missing required properties\";\n case IModelHubStatus.InvalidPropertiesValues: return \"Invalid properties values\";\n case IModelHubStatus.UserDoesNotHavePermission: return \"User does not have permission\";\n case IModelHubStatus.UserDoesNotHaveAccess: return \"User does not have access\";\n case IModelHubStatus.InvalidBriefcase: return \"Invalid briefcase\";\n case IModelHubStatus.BriefcaseDoesNotExist: return \"Briefcase does not exist\";\n case IModelHubStatus.BriefcaseDoesNotBelongToUser: return \"Briefcase does not belong to user\";\n case IModelHubStatus.AnotherUserPushing: return \"Another user pushing\";\n case IModelHubStatus.ChangeSetAlreadyExists: return \"ChangeSet already exists\";\n case IModelHubStatus.ChangeSetDoesNotExist: return \"ChangeSet does not exist\";\n case IModelHubStatus.FileIsNotUploaded: return \"File is not uploaded\";\n case IModelHubStatus.iModelIsNotInitialized: return \"iModel is not initialized\";\n case IModelHubStatus.ChangeSetPointsToBadSeed: return \"ChangeSet points to a bad seed file\";\n case IModelHubStatus.OperationFailed: return \"iModelHub operation has failed\";\n case IModelHubStatus.PullIsRequired: return \"Pull is required\";\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return \"Limit of briefcases per user was reached\";\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return \"Limit of briefcases per user per minute was reached\";\n case IModelHubStatus.DatabaseTemporarilyLocked: return \"Database is temporarily locked\";\n case IModelHubStatus.iModelIsLocked: return \"iModel is locked\";\n case IModelHubStatus.CodesExist: return \"Code already exists\";\n case IModelHubStatus.LocksExist: return \"Lock already exists\";\n case IModelHubStatus.iModelAlreadyExists: return \"iModel already exists\";\n case IModelHubStatus.iModelDoesNotExist: return \"iModel does not exist\";\n case IModelHubStatus.LockDoesNotExist: return \"Lock does not exist\";\n case IModelHubStatus.LockChunkDoesNotExist: return \"Lock chunk does not exist\";\n case IModelHubStatus.LockOwnedByAnotherBriefcase: return \"Lock is owned by another briefcase\";\n case IModelHubStatus.CodeStateInvalid: return \"Code state is invalid\";\n case IModelHubStatus.CodeReservedByAnotherBriefcase: return \"Code is reserved by another briefcase\";\n case IModelHubStatus.CodeDoesNotExist: return \"Code does not exist\";\n case IModelHubStatus.FileDoesNotExist: return \"File does not exist\";\n case IModelHubStatus.FileAlreadyExists: return \"File already exists\";\n case IModelHubStatus.EventTypeDoesNotExist: return \"Event type does not exist\";\n case IModelHubStatus.EventSubscriptionDoesNotExist: return \"Event subscription does not exist\";\n case IModelHubStatus.EventSubscriptionAlreadyExists: return \"Event subscription already exists\";\n case IModelHubStatus.ITwinIdIsNotSpecified: return \"ITwin Id is not specified\";\n case IModelHubStatus.FailedToGetITwinPermissions: return \"Failed to get iTwin permissions\";\n case IModelHubStatus.FailedToGetITwinMembers: return \"Failed to get iTwin members\";\n case IModelHubStatus.FailedToGetAssetPermissions: return \"Failed to get asset permissions\";\n case IModelHubStatus.FailedToGetAssetMembers: return \"Failed to get asset members\";\n case IModelHubStatus.ChangeSetAlreadyHasVersion: return \"ChangeSet already has version\";\n case IModelHubStatus.VersionAlreadyExists: return \"Version already exists\";\n case IModelHubStatus.JobSchedulingFailed: return \"Failed to schedule a background job\";\n case IModelHubStatus.ConflictsAggregate: return \"Codes or locks are owned by another briefcase\";\n case IModelHubStatus.FailedToGetITwinById: return \"Failed to query iTwin by its id\";\n case IModelHubStatus.DatabaseOperationFailed: return \"Database operation has failed\";\n case IModelHubStatus.ITwinDoesNotExist: return \"ITwin does not exist\";\n case IModelHubStatus.UndefinedArgumentError: return \"Undefined argument\";\n case IModelHubStatus.InvalidArgumentError: return \"Invalid argument\";\n case IModelHubStatus.MissingDownloadUrlError: return \"Missing download url\";\n case IModelHubStatus.NotSupportedInBrowser: return \"Not supported in browser\";\n case IModelHubStatus.FileHandlerNotSet: return \"File handler is not set\";\n case IModelHubStatus.FileNotFound: return \"File not found\";\n case GeoServiceStatus.NoGeoLocation: return \"No GeoLocation\";\n case GeoServiceStatus.OutOfUsefulRange: return \"Out of useful range\";\n case GeoServiceStatus.OutOfMathematicalDomain: return \"Out of mathematical domain\";\n case GeoServiceStatus.NoDatumConverter: return \"No datum converter\";\n case GeoServiceStatus.VerticalDatumConvertError: return \"Vertical datum convert error\";\n case GeoServiceStatus.CSMapError: return \"CSMap error\";\n case GeoServiceStatus.Pending: return \"Pending\"; // eslint-disable-line @typescript-eslint/no-deprecated\n case RealityDataStatus.InvalidData: return \"Invalid or unknown data\";\n case DbResult.BE_SQLITE_OK:\n case DbResult.BE_SQLITE_ROW:\n case DbResult.BE_SQLITE_DONE:\n case BentleyStatus.SUCCESS:\n return \"Success\";\n\n default:\n return `Error (${errorNumber})`;\n }\n }\n\n /** Use run-time type checking to safely get a useful string summary of an unknown error value, or `\"\"` if none exists.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`\n * @public\n */\n public static getErrorMessage(error: unknown): string {\n if (typeof error === \"string\")\n return error;\n\n if (error instanceof Error)\n return error.toString();\n\n if (JsonUtils.isObject(error)) {\n if (typeof error.message === \"string\")\n return error.message;\n\n if (typeof error.msg === \"string\")\n return error.msg;\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n if (error.toString() !== \"[object Object]\")\n return error.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string\n }\n\n return \"\";\n }\n\n /** Use run-time type checking to safely get the call stack of an unknown error value, if possible.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`\n * @public\n */\n public static getErrorStack(error: unknown): string | undefined {\n if (JsonUtils.isObject(error) && typeof error.stack === \"string\")\n return error.stack;\n\n return undefined;\n }\n\n /** Use run-time type checking to safely get the metadata with an unknown error value, if possible.\n * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof BentleyError`\n * @see [[BentleyError.getMetaData]]\n * @public\n */\n public static getErrorMetadata(error: unknown): object | undefined {\n if (JsonUtils.isObject(error) && typeof error.getMetaData === \"function\") {\n const metadata = error.getMetaData();\n if (typeof metadata === \"object\" && metadata !== null)\n return metadata;\n }\n\n return undefined;\n }\n\n /** Returns a new `ErrorProps` object representing an unknown error value. Useful for logging or wrapping/re-throwing caught errors.\n * @note Unlike `Error` objects (which lose messages and call stacks when serialized to JSON), objects\n * returned by this are plain old JavaScript objects, and can be easily logged/serialized to JSON.\n * @public\n */\n public static getErrorProps(error: unknown): ErrorProps {\n const serialized: ErrorProps = {\n message: BentleyError.getErrorMessage(error),\n };\n\n const stack = BentleyError.getErrorStack(error);\n if (stack)\n serialized.stack = stack;\n\n const metadata = BentleyError.getErrorMetadata(error);\n if (metadata)\n serialized.metadata = metadata;\n\n return serialized;\n }\n}\n\n"]}