@itwin/core-bentley 3.5.0-dev.8 → 3.5.1

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.
Files changed (238) hide show
  1. package/CHANGELOG.md +80 -1
  2. package/lib/cjs/AccessToken.d.ts +8 -8
  3. package/lib/cjs/AccessToken.js +9 -9
  4. package/lib/cjs/AccessToken.js.map +1 -1
  5. package/lib/cjs/Assert.d.ts +25 -25
  6. package/lib/cjs/Assert.js +45 -45
  7. package/lib/cjs/Assert.js.map +1 -1
  8. package/lib/cjs/AsyncMutex.d.ts +26 -26
  9. package/lib/cjs/AsyncMutex.js +43 -43
  10. package/lib/cjs/AsyncMutex.js.map +1 -1
  11. package/lib/cjs/BeEvent.d.ts +81 -81
  12. package/lib/cjs/BeEvent.js +156 -156
  13. package/lib/cjs/BeEvent.js.map +1 -1
  14. package/lib/cjs/BeSQLite.d.ts +170 -170
  15. package/lib/cjs/BeSQLite.js +183 -183
  16. package/lib/cjs/BeSQLite.js.map +1 -1
  17. package/lib/cjs/BentleyError.d.ts +378 -376
  18. package/lib/cjs/BentleyError.d.ts.map +1 -1
  19. package/lib/cjs/BentleyError.js +702 -699
  20. package/lib/cjs/BentleyError.js.map +1 -1
  21. package/lib/cjs/BentleyLoggerCategory.d.ts +11 -11
  22. package/lib/cjs/BentleyLoggerCategory.js +19 -19
  23. package/lib/cjs/BentleyLoggerCategory.js.map +1 -1
  24. package/lib/cjs/ByteStream.d.ts +110 -92
  25. package/lib/cjs/ByteStream.d.ts.map +1 -1
  26. package/lib/cjs/ByteStream.js +159 -133
  27. package/lib/cjs/ByteStream.js.map +1 -1
  28. package/lib/cjs/ClassUtils.d.ts +14 -14
  29. package/lib/cjs/ClassUtils.js +27 -27
  30. package/lib/cjs/ClassUtils.js.map +1 -1
  31. package/lib/cjs/Compare.d.ts +47 -47
  32. package/lib/cjs/Compare.js +75 -75
  33. package/lib/cjs/Compare.js.map +1 -1
  34. package/lib/cjs/CompressedId64Set.d.ts +134 -134
  35. package/lib/cjs/CompressedId64Set.js +428 -428
  36. package/lib/cjs/CompressedId64Set.js.map +1 -1
  37. package/lib/cjs/Dictionary.d.ts +125 -125
  38. package/lib/cjs/Dictionary.js +203 -203
  39. package/lib/cjs/Dictionary.js.map +1 -1
  40. package/lib/cjs/Disposable.d.ts +80 -80
  41. package/lib/cjs/Disposable.js +120 -120
  42. package/lib/cjs/Disposable.js.map +1 -1
  43. package/lib/cjs/Id.d.ts +277 -277
  44. package/lib/cjs/Id.js +629 -629
  45. package/lib/cjs/Id.js.map +1 -1
  46. package/lib/cjs/IndexMap.d.ts +65 -65
  47. package/lib/cjs/IndexMap.js +91 -91
  48. package/lib/cjs/IndexMap.js.map +1 -1
  49. package/lib/cjs/JsonSchema.d.ts +77 -77
  50. package/lib/cjs/JsonSchema.js +9 -9
  51. package/lib/cjs/JsonSchema.js.map +1 -1
  52. package/lib/cjs/JsonUtils.d.ts +78 -78
  53. package/lib/cjs/JsonUtils.js +151 -151
  54. package/lib/cjs/JsonUtils.js.map +1 -1
  55. package/lib/cjs/LRUMap.d.ts +129 -129
  56. package/lib/cjs/LRUMap.js +333 -333
  57. package/lib/cjs/LRUMap.js.map +1 -1
  58. package/lib/cjs/Logger.d.ts +143 -141
  59. package/lib/cjs/Logger.d.ts.map +1 -1
  60. package/lib/cjs/Logger.js +258 -254
  61. package/lib/cjs/Logger.js.map +1 -1
  62. package/lib/cjs/ObservableSet.d.ts +23 -23
  63. package/lib/cjs/ObservableSet.js +51 -51
  64. package/lib/cjs/ObservableSet.js.map +1 -1
  65. package/lib/cjs/OneAtATimeAction.d.ts +31 -31
  66. package/lib/cjs/OneAtATimeAction.js +94 -94
  67. package/lib/cjs/OneAtATimeAction.js.map +1 -1
  68. package/lib/cjs/OrderedId64Iterable.d.ts +74 -74
  69. package/lib/cjs/OrderedId64Iterable.js +235 -235
  70. package/lib/cjs/OrderedId64Iterable.js.map +1 -1
  71. package/lib/cjs/OrderedSet.d.ts +40 -40
  72. package/lib/cjs/OrderedSet.js +64 -64
  73. package/lib/cjs/OrderedSet.js.map +1 -1
  74. package/lib/cjs/PriorityQueue.d.ts +70 -70
  75. package/lib/cjs/PriorityQueue.js +140 -140
  76. package/lib/cjs/PriorityQueue.js.map +1 -1
  77. package/lib/cjs/ProcessDetector.d.ts +59 -59
  78. package/lib/cjs/ProcessDetector.js +71 -71
  79. package/lib/cjs/ProcessDetector.js.map +1 -1
  80. package/lib/cjs/SortedArray.d.ts +232 -232
  81. package/lib/cjs/SortedArray.js +303 -303
  82. package/lib/cjs/SortedArray.js.map +1 -1
  83. package/lib/cjs/StatusCategory.d.ts +30 -30
  84. package/lib/cjs/StatusCategory.js +460 -460
  85. package/lib/cjs/StatusCategory.js.map +1 -1
  86. package/lib/cjs/StringUtils.d.ts +22 -22
  87. package/lib/cjs/StringUtils.js +148 -148
  88. package/lib/cjs/StringUtils.js.map +1 -1
  89. package/lib/cjs/Time.d.ts +122 -122
  90. package/lib/cjs/Time.js +152 -152
  91. package/lib/cjs/Time.js.map +1 -1
  92. package/lib/cjs/Tracing.d.ts +40 -40
  93. package/lib/cjs/Tracing.js +130 -130
  94. package/lib/cjs/Tracing.js.map +1 -1
  95. package/lib/cjs/TupleKeyedMap.d.ts +37 -0
  96. package/lib/cjs/TupleKeyedMap.d.ts.map +1 -0
  97. package/lib/cjs/TupleKeyedMap.js +103 -0
  98. package/lib/cjs/TupleKeyedMap.js.map +1 -0
  99. package/lib/cjs/TypedArrayBuilder.d.ts +155 -97
  100. package/lib/cjs/TypedArrayBuilder.d.ts.map +1 -1
  101. package/lib/cjs/TypedArrayBuilder.js +208 -134
  102. package/lib/cjs/TypedArrayBuilder.js.map +1 -1
  103. package/lib/cjs/UnexpectedErrors.d.ts +43 -43
  104. package/lib/cjs/UnexpectedErrors.js +68 -68
  105. package/lib/cjs/UnexpectedErrors.js.map +1 -1
  106. package/lib/cjs/UtilityTypes.d.ts +100 -86
  107. package/lib/cjs/UtilityTypes.d.ts.map +1 -1
  108. package/lib/cjs/UtilityTypes.js +40 -26
  109. package/lib/cjs/UtilityTypes.js.map +1 -1
  110. package/lib/cjs/YieldManager.d.ts +18 -18
  111. package/lib/cjs/YieldManager.js +34 -34
  112. package/lib/cjs/YieldManager.js.map +1 -1
  113. package/lib/cjs/core-bentley.d.ts +75 -74
  114. package/lib/cjs/core-bentley.d.ts.map +1 -1
  115. package/lib/cjs/core-bentley.js +91 -90
  116. package/lib/cjs/core-bentley.js.map +1 -1
  117. package/lib/cjs/partitionArray.d.ts +21 -21
  118. package/lib/cjs/partitionArray.js +43 -43
  119. package/lib/cjs/partitionArray.js.map +1 -1
  120. package/lib/esm/AccessToken.d.ts +8 -8
  121. package/lib/esm/AccessToken.js +8 -8
  122. package/lib/esm/AccessToken.js.map +1 -1
  123. package/lib/esm/Assert.d.ts +25 -25
  124. package/lib/esm/Assert.js +41 -41
  125. package/lib/esm/Assert.js.map +1 -1
  126. package/lib/esm/AsyncMutex.d.ts +26 -26
  127. package/lib/esm/AsyncMutex.js +39 -39
  128. package/lib/esm/AsyncMutex.js.map +1 -1
  129. package/lib/esm/BeEvent.d.ts +81 -81
  130. package/lib/esm/BeEvent.js +150 -150
  131. package/lib/esm/BeEvent.js.map +1 -1
  132. package/lib/esm/BeSQLite.d.ts +170 -170
  133. package/lib/esm/BeSQLite.js +180 -180
  134. package/lib/esm/BeSQLite.js.map +1 -1
  135. package/lib/esm/BentleyError.d.ts +378 -376
  136. package/lib/esm/BentleyError.d.ts.map +1 -1
  137. package/lib/esm/BentleyError.js +698 -695
  138. package/lib/esm/BentleyError.js.map +1 -1
  139. package/lib/esm/BentleyLoggerCategory.d.ts +11 -11
  140. package/lib/esm/BentleyLoggerCategory.js +16 -16
  141. package/lib/esm/BentleyLoggerCategory.js.map +1 -1
  142. package/lib/esm/ByteStream.d.ts +110 -92
  143. package/lib/esm/ByteStream.d.ts.map +1 -1
  144. package/lib/esm/ByteStream.js +155 -129
  145. package/lib/esm/ByteStream.js.map +1 -1
  146. package/lib/esm/ClassUtils.d.ts +14 -14
  147. package/lib/esm/ClassUtils.js +22 -22
  148. package/lib/esm/ClassUtils.js.map +1 -1
  149. package/lib/esm/Compare.d.ts +47 -47
  150. package/lib/esm/Compare.js +63 -63
  151. package/lib/esm/Compare.js.map +1 -1
  152. package/lib/esm/CompressedId64Set.d.ts +134 -134
  153. package/lib/esm/CompressedId64Set.js +423 -423
  154. package/lib/esm/CompressedId64Set.js.map +1 -1
  155. package/lib/esm/Dictionary.d.ts +125 -125
  156. package/lib/esm/Dictionary.js +199 -199
  157. package/lib/esm/Dictionary.js.map +1 -1
  158. package/lib/esm/Disposable.d.ts +80 -80
  159. package/lib/esm/Disposable.js +112 -112
  160. package/lib/esm/Disposable.js.map +1 -1
  161. package/lib/esm/Id.d.ts +277 -277
  162. package/lib/esm/Id.js +625 -625
  163. package/lib/esm/Id.js.map +1 -1
  164. package/lib/esm/IndexMap.d.ts +65 -65
  165. package/lib/esm/IndexMap.js +86 -86
  166. package/lib/esm/IndexMap.js.map +1 -1
  167. package/lib/esm/JsonSchema.d.ts +77 -77
  168. package/lib/esm/JsonSchema.js +8 -8
  169. package/lib/esm/JsonSchema.js.map +1 -1
  170. package/lib/esm/JsonUtils.d.ts +78 -78
  171. package/lib/esm/JsonUtils.js +148 -148
  172. package/lib/esm/JsonUtils.js.map +1 -1
  173. package/lib/esm/LRUMap.d.ts +129 -129
  174. package/lib/esm/LRUMap.js +326 -326
  175. package/lib/esm/LRUMap.js.map +1 -1
  176. package/lib/esm/Logger.d.ts +143 -141
  177. package/lib/esm/Logger.d.ts.map +1 -1
  178. package/lib/esm/Logger.js +253 -249
  179. package/lib/esm/Logger.js.map +1 -1
  180. package/lib/esm/ObservableSet.d.ts +23 -23
  181. package/lib/esm/ObservableSet.js +47 -47
  182. package/lib/esm/ObservableSet.js.map +1 -1
  183. package/lib/esm/OneAtATimeAction.d.ts +31 -31
  184. package/lib/esm/OneAtATimeAction.js +89 -89
  185. package/lib/esm/OneAtATimeAction.js.map +1 -1
  186. package/lib/esm/OrderedId64Iterable.d.ts +74 -74
  187. package/lib/esm/OrderedId64Iterable.js +232 -232
  188. package/lib/esm/OrderedId64Iterable.js.map +1 -1
  189. package/lib/esm/OrderedSet.d.ts +40 -40
  190. package/lib/esm/OrderedSet.js +59 -59
  191. package/lib/esm/OrderedSet.js.map +1 -1
  192. package/lib/esm/PriorityQueue.d.ts +70 -70
  193. package/lib/esm/PriorityQueue.js +136 -136
  194. package/lib/esm/PriorityQueue.js.map +1 -1
  195. package/lib/esm/ProcessDetector.d.ts +59 -59
  196. package/lib/esm/ProcessDetector.js +67 -67
  197. package/lib/esm/ProcessDetector.js.map +1 -1
  198. package/lib/esm/SortedArray.d.ts +232 -232
  199. package/lib/esm/SortedArray.js +296 -296
  200. package/lib/esm/SortedArray.js.map +1 -1
  201. package/lib/esm/StatusCategory.d.ts +30 -30
  202. package/lib/esm/StatusCategory.js +454 -454
  203. package/lib/esm/StatusCategory.js.map +1 -1
  204. package/lib/esm/StringUtils.d.ts +22 -22
  205. package/lib/esm/StringUtils.js +142 -142
  206. package/lib/esm/StringUtils.js.map +1 -1
  207. package/lib/esm/Time.d.ts +122 -122
  208. package/lib/esm/Time.js +146 -146
  209. package/lib/esm/Time.js.map +1 -1
  210. package/lib/esm/Tracing.d.ts +40 -40
  211. package/lib/esm/Tracing.js +126 -126
  212. package/lib/esm/Tracing.js.map +1 -1
  213. package/lib/esm/TupleKeyedMap.d.ts +37 -0
  214. package/lib/esm/TupleKeyedMap.d.ts.map +1 -0
  215. package/lib/esm/TupleKeyedMap.js +99 -0
  216. package/lib/esm/TupleKeyedMap.js.map +1 -0
  217. package/lib/esm/TypedArrayBuilder.d.ts +155 -97
  218. package/lib/esm/TypedArrayBuilder.d.ts.map +1 -1
  219. package/lib/esm/TypedArrayBuilder.js +200 -127
  220. package/lib/esm/TypedArrayBuilder.js.map +1 -1
  221. package/lib/esm/UnexpectedErrors.d.ts +43 -43
  222. package/lib/esm/UnexpectedErrors.js +64 -64
  223. package/lib/esm/UnexpectedErrors.js.map +1 -1
  224. package/lib/esm/UtilityTypes.d.ts +100 -86
  225. package/lib/esm/UtilityTypes.d.ts.map +1 -1
  226. package/lib/esm/UtilityTypes.js +34 -21
  227. package/lib/esm/UtilityTypes.js.map +1 -1
  228. package/lib/esm/YieldManager.d.ts +18 -18
  229. package/lib/esm/YieldManager.js +30 -30
  230. package/lib/esm/YieldManager.js.map +1 -1
  231. package/lib/esm/core-bentley.d.ts +75 -74
  232. package/lib/esm/core-bentley.d.ts.map +1 -1
  233. package/lib/esm/core-bentley.js +79 -78
  234. package/lib/esm/core-bentley.js.map +1 -1
  235. package/lib/esm/partitionArray.d.ts +21 -21
  236. package/lib/esm/partitionArray.js +39 -39
  237. package/lib/esm/partitionArray.js.map +1 -1
  238. package/package.json +4 -4
@@ -1,696 +1,699 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Errors
7
- */
8
- import { DbResult } from "./BeSQLite";
9
- /** Standard status code.
10
- * This status code should be rarely used.
11
- * Prefer to throw an exception to indicate an error, rather than returning a special status code.
12
- * If a status code is to be returned, prefer to return a more specific error status type such as IModelStatus or DbResult.
13
- * @public
14
- */
15
- export var BentleyStatus;
16
- (function (BentleyStatus) {
17
- BentleyStatus[BentleyStatus["SUCCESS"] = 0] = "SUCCESS";
18
- BentleyStatus[BentleyStatus["ERROR"] = 32768] = "ERROR";
19
- })(BentleyStatus || (BentleyStatus = {}));
20
- /** Status codes that are used in conjunction with [[BentleyError]].
21
- * 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.
22
- * @public
23
- */
24
- export var IModelStatus;
25
- (function (IModelStatus) {
26
- IModelStatus[IModelStatus["IMODEL_ERROR_BASE"] = 65536] = "IMODEL_ERROR_BASE";
27
- IModelStatus[IModelStatus["Success"] = 0] = "Success";
28
- IModelStatus[IModelStatus["AlreadyLoaded"] = 65537] = "AlreadyLoaded";
29
- IModelStatus[IModelStatus["AlreadyOpen"] = 65538] = "AlreadyOpen";
30
- IModelStatus[IModelStatus["BadArg"] = 65539] = "BadArg";
31
- IModelStatus[IModelStatus["BadElement"] = 65540] = "BadElement";
32
- IModelStatus[IModelStatus["BadModel"] = 65541] = "BadModel";
33
- IModelStatus[IModelStatus["BadRequest"] = 65542] = "BadRequest";
34
- IModelStatus[IModelStatus["BadSchema"] = 65543] = "BadSchema";
35
- IModelStatus[IModelStatus["CannotUndo"] = 65544] = "CannotUndo";
36
- IModelStatus[IModelStatus["CodeNotReserved"] = 65545] = "CodeNotReserved";
37
- IModelStatus[IModelStatus["DeletionProhibited"] = 65546] = "DeletionProhibited";
38
- IModelStatus[IModelStatus["DuplicateCode"] = 65547] = "DuplicateCode";
39
- IModelStatus[IModelStatus["DuplicateName"] = 65548] = "DuplicateName";
40
- IModelStatus[IModelStatus["ElementBlockedChange"] = 65549] = "ElementBlockedChange";
41
- IModelStatus[IModelStatus["FileAlreadyExists"] = 65550] = "FileAlreadyExists";
42
- IModelStatus[IModelStatus["FileNotFound"] = 65551] = "FileNotFound";
43
- IModelStatus[IModelStatus["FileNotLoaded"] = 65552] = "FileNotLoaded";
44
- IModelStatus[IModelStatus["ForeignKeyConstraint"] = 65553] = "ForeignKeyConstraint";
45
- IModelStatus[IModelStatus["IdExists"] = 65554] = "IdExists";
46
- IModelStatus[IModelStatus["InDynamicTransaction"] = 65555] = "InDynamicTransaction";
47
- IModelStatus[IModelStatus["InvalidCategory"] = 65556] = "InvalidCategory";
48
- IModelStatus[IModelStatus["InvalidCode"] = 65557] = "InvalidCode";
49
- IModelStatus[IModelStatus["InvalidCodeSpec"] = 65558] = "InvalidCodeSpec";
50
- IModelStatus[IModelStatus["InvalidId"] = 65559] = "InvalidId";
51
- IModelStatus[IModelStatus["InvalidName"] = 65560] = "InvalidName";
52
- IModelStatus[IModelStatus["InvalidParent"] = 65561] = "InvalidParent";
53
- IModelStatus[IModelStatus["InvalidProfileVersion"] = 65562] = "InvalidProfileVersion";
54
- IModelStatus[IModelStatus["IsCreatingChangeSet"] = 65563] = "IsCreatingChangeSet";
55
- IModelStatus[IModelStatus["LockNotHeld"] = 65564] = "LockNotHeld";
56
- IModelStatus[IModelStatus["Mismatch2d3d"] = 65565] = "Mismatch2d3d";
57
- IModelStatus[IModelStatus["MismatchGcs"] = 65566] = "MismatchGcs";
58
- IModelStatus[IModelStatus["MissingDomain"] = 65567] = "MissingDomain";
59
- IModelStatus[IModelStatus["MissingHandler"] = 65568] = "MissingHandler";
60
- IModelStatus[IModelStatus["MissingId"] = 65569] = "MissingId";
61
- IModelStatus[IModelStatus["NoGeometry"] = 65570] = "NoGeometry";
62
- IModelStatus[IModelStatus["NoMultiTxnOperation"] = 65571] = "NoMultiTxnOperation";
63
- IModelStatus[IModelStatus["NotEnabled"] = 65573] = "NotEnabled";
64
- IModelStatus[IModelStatus["NotFound"] = 65574] = "NotFound";
65
- IModelStatus[IModelStatus["NotOpen"] = 65575] = "NotOpen";
66
- IModelStatus[IModelStatus["NotOpenForWrite"] = 65576] = "NotOpenForWrite";
67
- IModelStatus[IModelStatus["NotSameUnitBase"] = 65577] = "NotSameUnitBase";
68
- IModelStatus[IModelStatus["NothingToRedo"] = 65578] = "NothingToRedo";
69
- IModelStatus[IModelStatus["NothingToUndo"] = 65579] = "NothingToUndo";
70
- IModelStatus[IModelStatus["ParentBlockedChange"] = 65580] = "ParentBlockedChange";
71
- IModelStatus[IModelStatus["ReadError"] = 65581] = "ReadError";
72
- IModelStatus[IModelStatus["ReadOnly"] = 65582] = "ReadOnly";
73
- IModelStatus[IModelStatus["ReadOnlyDomain"] = 65583] = "ReadOnlyDomain";
74
- IModelStatus[IModelStatus["RepositoryManagerError"] = 65584] = "RepositoryManagerError";
75
- IModelStatus[IModelStatus["SQLiteError"] = 65585] = "SQLiteError";
76
- IModelStatus[IModelStatus["TransactionActive"] = 65586] = "TransactionActive";
77
- IModelStatus[IModelStatus["UnitsMissing"] = 65587] = "UnitsMissing";
78
- IModelStatus[IModelStatus["UnknownFormat"] = 65588] = "UnknownFormat";
79
- IModelStatus[IModelStatus["UpgradeFailed"] = 65589] = "UpgradeFailed";
80
- IModelStatus[IModelStatus["ValidationFailed"] = 65590] = "ValidationFailed";
81
- IModelStatus[IModelStatus["VersionTooNew"] = 65591] = "VersionTooNew";
82
- IModelStatus[IModelStatus["VersionTooOld"] = 65592] = "VersionTooOld";
83
- IModelStatus[IModelStatus["ViewNotFound"] = 65593] = "ViewNotFound";
84
- IModelStatus[IModelStatus["WriteError"] = 65594] = "WriteError";
85
- IModelStatus[IModelStatus["WrongClass"] = 65595] = "WrongClass";
86
- IModelStatus[IModelStatus["WrongIModel"] = 65596] = "WrongIModel";
87
- IModelStatus[IModelStatus["WrongDomain"] = 65597] = "WrongDomain";
88
- IModelStatus[IModelStatus["WrongElement"] = 65598] = "WrongElement";
89
- IModelStatus[IModelStatus["WrongHandler"] = 65599] = "WrongHandler";
90
- IModelStatus[IModelStatus["WrongModel"] = 65600] = "WrongModel";
91
- IModelStatus[IModelStatus["ConstraintNotUnique"] = 65601] = "ConstraintNotUnique";
92
- IModelStatus[IModelStatus["NoGeoLocation"] = 65602] = "NoGeoLocation";
93
- IModelStatus[IModelStatus["ServerTimeout"] = 65603] = "ServerTimeout";
94
- IModelStatus[IModelStatus["NoContent"] = 65604] = "NoContent";
95
- IModelStatus[IModelStatus["NotRegistered"] = 65605] = "NotRegistered";
96
- IModelStatus[IModelStatus["FunctionNotFound"] = 65606] = "FunctionNotFound";
97
- IModelStatus[IModelStatus["NoActiveCommand"] = 65607] = "NoActiveCommand";
98
- })(IModelStatus || (IModelStatus = {}));
99
- /** Error status from various briefcase operations
100
- * @beta Should these be internal?
101
- */
102
- export var BriefcaseStatus;
103
- (function (BriefcaseStatus) {
104
- BriefcaseStatus[BriefcaseStatus["BRIEFCASE_STATUS_BASE"] = 131072] = "BRIEFCASE_STATUS_BASE";
105
- BriefcaseStatus[BriefcaseStatus["CannotAcquire"] = 131072] = "CannotAcquire";
106
- BriefcaseStatus[BriefcaseStatus["CannotDownload"] = 131073] = "CannotDownload";
107
- BriefcaseStatus[BriefcaseStatus["CannotUpload"] = 131074] = "CannotUpload";
108
- BriefcaseStatus[BriefcaseStatus["CannotCopy"] = 131075] = "CannotCopy";
109
- BriefcaseStatus[BriefcaseStatus["CannotDelete"] = 131076] = "CannotDelete";
110
- BriefcaseStatus[BriefcaseStatus["VersionNotFound"] = 131077] = "VersionNotFound";
111
- BriefcaseStatus[BriefcaseStatus["CannotApplyChanges"] = 131078] = "CannotApplyChanges";
112
- BriefcaseStatus[BriefcaseStatus["DownloadCancelled"] = 131079] = "DownloadCancelled";
113
- BriefcaseStatus[BriefcaseStatus["ContainsDeletedChangeSets"] = 131080] = "ContainsDeletedChangeSets";
114
- })(BriefcaseStatus || (BriefcaseStatus = {}));
115
- /** RpcInterface status codes
116
- * @beta Should these be internal?
117
- */
118
- export var RpcInterfaceStatus;
119
- (function (RpcInterfaceStatus) {
120
- RpcInterfaceStatus[RpcInterfaceStatus["Success"] = 0] = "Success";
121
- RpcInterfaceStatus[RpcInterfaceStatus["RPC_INTERFACE_ERROR_BASE"] = 135168] = "RPC_INTERFACE_ERROR_BASE";
122
- /** The RpcInterface implemented by the server is incompatible with the interface requested by the client. */
123
- RpcInterfaceStatus[RpcInterfaceStatus["IncompatibleVersion"] = 135168] = "IncompatibleVersion";
124
- })(RpcInterfaceStatus || (RpcInterfaceStatus = {}));
125
- /** Error status from various Changeset operations
126
- * @beta Should these be internal?
127
- */
128
- export var ChangeSetStatus;
129
- (function (ChangeSetStatus) {
130
- ChangeSetStatus[ChangeSetStatus["Success"] = 0] = "Success";
131
- ChangeSetStatus[ChangeSetStatus["CHANGESET_ERROR_BASE"] = 90112] = "CHANGESET_ERROR_BASE";
132
- /** Error applying a change set when reversing or reinstating it */
133
- ChangeSetStatus[ChangeSetStatus["ApplyError"] = 90113] = "ApplyError";
134
- /** Change tracking has not been enabled. The ChangeSet API mandates this. */
135
- ChangeSetStatus[ChangeSetStatus["ChangeTrackingNotEnabled"] = 90114] = "ChangeTrackingNotEnabled";
136
- /** Contents of the change stream are corrupted and does not match the ChangeSet */
137
- ChangeSetStatus[ChangeSetStatus["CorruptedChangeStream"] = 90115] = "CorruptedChangeStream";
138
- /** File containing the changes to the change set is not found */
139
- ChangeSetStatus[ChangeSetStatus["FileNotFound"] = 90116] = "FileNotFound";
140
- /** Error writing the contents of the change set to the backing change stream file */
141
- ChangeSetStatus[ChangeSetStatus["FileWriteError"] = 90117] = "FileWriteError";
142
- /** Cannot perform the operation since the Db has local changes */
143
- ChangeSetStatus[ChangeSetStatus["HasLocalChanges"] = 90118] = "HasLocalChanges";
144
- /** Cannot perform the operation since current transaction has uncommitted changes */
145
- ChangeSetStatus[ChangeSetStatus["HasUncommittedChanges"] = 90119] = "HasUncommittedChanges";
146
- /** Invalid ChangeSet Id */
147
- ChangeSetStatus[ChangeSetStatus["InvalidId"] = 90120] = "InvalidId";
148
- /** Invalid version of the change set */
149
- ChangeSetStatus[ChangeSetStatus["InvalidVersion"] = 90121] = "InvalidVersion";
150
- /** Cannot perform the operation since system is in the middle of a dynamic transaction */
151
- ChangeSetStatus[ChangeSetStatus["InDynamicTransaction"] = 90122] = "InDynamicTransaction";
152
- /** Cannot perform operation since system is in the middle of a creating a change set */
153
- ChangeSetStatus[ChangeSetStatus["IsCreatingChangeSet"] = 90123] = "IsCreatingChangeSet";
154
- /** Cannot perform operation since the system is not creating a change set */
155
- ChangeSetStatus[ChangeSetStatus["IsNotCreatingChangeSet"] = 90124] = "IsNotCreatingChangeSet";
156
- /** Error propagating the changes after the merge */
157
- ChangeSetStatus[ChangeSetStatus["MergePropagationError"] = 90125] = "MergePropagationError";
158
- /** No change sets to merge */
159
- ChangeSetStatus[ChangeSetStatus["NothingToMerge"] = 90126] = "NothingToMerge";
160
- /** No transactions are available to create a change set */
161
- ChangeSetStatus[ChangeSetStatus["NoTransactions"] = 90127] = "NoTransactions";
162
- /** Parent change set of the Db does not match the parent id of the change set */
163
- ChangeSetStatus[ChangeSetStatus["ParentMismatch"] = 90128] = "ParentMismatch";
164
- /** Error performing a SQLite operation on the Db */
165
- ChangeSetStatus[ChangeSetStatus["SQLiteError"] = 90129] = "SQLiteError";
166
- /** ChangeSet originated in a different Db */
167
- ChangeSetStatus[ChangeSetStatus["WrongDgnDb"] = 90130] = "WrongDgnDb";
168
- /** Could not open the DgnDb to merge change set */
169
- ChangeSetStatus[ChangeSetStatus["CouldNotOpenDgnDb"] = 90131] = "CouldNotOpenDgnDb";
170
- /** Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */
171
- ChangeSetStatus[ChangeSetStatus["MergeSchemaChangesOnOpen"] = 90132] = "MergeSchemaChangesOnOpen";
172
- /** Cannot reverse or reinstate schema changes. */
173
- ChangeSetStatus[ChangeSetStatus["ReverseOrReinstateSchemaChanges"] = 90133] = "ReverseOrReinstateSchemaChanges";
174
- /** Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */
175
- ChangeSetStatus[ChangeSetStatus["ProcessSchemaChangesOnOpen"] = 90134] = "ProcessSchemaChangesOnOpen";
176
- /** Cannot merge changes into a Readonly DgnDb. */
177
- ChangeSetStatus[ChangeSetStatus["CannotMergeIntoReadonly"] = 90135] = "CannotMergeIntoReadonly";
178
- /** Cannot merge changes into a Master DgnDb. */
179
- ChangeSetStatus[ChangeSetStatus["CannotMergeIntoMaster"] = 90136] = "CannotMergeIntoMaster";
180
- /** Cannot merge changes into a DgnDb that has reversed change sets. */
181
- ChangeSetStatus[ChangeSetStatus["CannotMergeIntoReversed"] = 90137] = "CannotMergeIntoReversed";
182
- })(ChangeSetStatus || (ChangeSetStatus = {}));
183
- /** Return codes for methods which perform repository management operations
184
- * @beta Should these be internal?
185
- */
186
- export var RepositoryStatus;
187
- (function (RepositoryStatus) {
188
- RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
189
- /** The repository server did not respond to a request */
190
- RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
191
- /** A requested lock was already held by another briefcase */
192
- RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
193
- /** Failed to sync briefcase manager with server */
194
- RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
195
- /** Response from server not understood */
196
- RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
197
- /** An operation requires local changes to be committed or abandoned */
198
- RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
199
- /** A lock cannot be relinquished because the associated object has been modified */
200
- RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
201
- /** An operation required creation of a ChangeSet, which failed */
202
- RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
203
- /** Request to server not understood */
204
- RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
205
- /** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
206
- RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
207
- /** A requested DgnCode is reserved by another briefcase or in use */
208
- RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
209
- /** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
210
- RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
211
- /** A DgnCode cannot be relinquished because it has been used locally */
212
- RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
213
- /** A required lock is not held by this briefcase */
214
- RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
215
- /** Repository is currently locked, no changes allowed */
216
- RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
217
- /** Channel write constraint violation, such as an attempt to write outside the designated channel. */
218
- RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
219
- })(RepositoryStatus || (RepositoryStatus = {}));
220
- /** Status from returned HTTP status code
221
- * @beta Should these be internal?
222
- */
223
- export var HttpStatus;
224
- (function (HttpStatus) {
225
- /** 2xx Success */
226
- HttpStatus[HttpStatus["Success"] = 0] = "Success";
227
- /** 1xx Informational responses */
228
- HttpStatus[HttpStatus["Info"] = 94209] = "Info";
229
- /** 3xx Redirection */
230
- HttpStatus[HttpStatus["Redirection"] = 94210] = "Redirection";
231
- /** 4xx Client errors */
232
- HttpStatus[HttpStatus["ClientError"] = 94211] = "ClientError";
233
- /** 5xx Server errors */
234
- HttpStatus[HttpStatus["ServerError"] = 94212] = "ServerError";
235
- })(HttpStatus || (HttpStatus = {}));
236
- /** iModelHub Services Errors
237
- * @beta Right package?
238
- */
239
- export var IModelHubStatus;
240
- (function (IModelHubStatus) {
241
- IModelHubStatus[IModelHubStatus["Success"] = 0] = "Success";
242
- IModelHubStatus[IModelHubStatus["IMODELHUBERROR_BASE"] = 102400] = "IMODELHUBERROR_BASE";
243
- IModelHubStatus[IModelHubStatus["IMODELHUBERROR_REQUESTERRORBASE"] = 102656] = "IMODELHUBERROR_REQUESTERRORBASE";
244
- IModelHubStatus[IModelHubStatus["Unknown"] = 102401] = "Unknown";
245
- IModelHubStatus[IModelHubStatus["MissingRequiredProperties"] = 102402] = "MissingRequiredProperties";
246
- IModelHubStatus[IModelHubStatus["InvalidPropertiesValues"] = 102403] = "InvalidPropertiesValues";
247
- IModelHubStatus[IModelHubStatus["UserDoesNotHavePermission"] = 102404] = "UserDoesNotHavePermission";
248
- IModelHubStatus[IModelHubStatus["UserDoesNotHaveAccess"] = 102405] = "UserDoesNotHaveAccess";
249
- IModelHubStatus[IModelHubStatus["InvalidBriefcase"] = 102406] = "InvalidBriefcase";
250
- IModelHubStatus[IModelHubStatus["BriefcaseDoesNotExist"] = 102407] = "BriefcaseDoesNotExist";
251
- IModelHubStatus[IModelHubStatus["BriefcaseDoesNotBelongToUser"] = 102408] = "BriefcaseDoesNotBelongToUser";
252
- IModelHubStatus[IModelHubStatus["AnotherUserPushing"] = 102409] = "AnotherUserPushing";
253
- IModelHubStatus[IModelHubStatus["ChangeSetAlreadyExists"] = 102410] = "ChangeSetAlreadyExists";
254
- IModelHubStatus[IModelHubStatus["ChangeSetDoesNotExist"] = 102411] = "ChangeSetDoesNotExist";
255
- IModelHubStatus[IModelHubStatus["FileIsNotUploaded"] = 102412] = "FileIsNotUploaded";
256
- IModelHubStatus[IModelHubStatus["iModelIsNotInitialized"] = 102413] = "iModelIsNotInitialized";
257
- IModelHubStatus[IModelHubStatus["ChangeSetPointsToBadSeed"] = 102414] = "ChangeSetPointsToBadSeed";
258
- IModelHubStatus[IModelHubStatus["OperationFailed"] = 102415] = "OperationFailed";
259
- IModelHubStatus[IModelHubStatus["PullIsRequired"] = 102416] = "PullIsRequired";
260
- IModelHubStatus[IModelHubStatus["MaximumNumberOfBriefcasesPerUser"] = 102417] = "MaximumNumberOfBriefcasesPerUser";
261
- IModelHubStatus[IModelHubStatus["MaximumNumberOfBriefcasesPerUserPerMinute"] = 102418] = "MaximumNumberOfBriefcasesPerUserPerMinute";
262
- IModelHubStatus[IModelHubStatus["DatabaseTemporarilyLocked"] = 102419] = "DatabaseTemporarilyLocked";
263
- IModelHubStatus[IModelHubStatus["iModelIsLocked"] = 102420] = "iModelIsLocked";
264
- IModelHubStatus[IModelHubStatus["CodesExist"] = 102421] = "CodesExist";
265
- IModelHubStatus[IModelHubStatus["LocksExist"] = 102422] = "LocksExist";
266
- IModelHubStatus[IModelHubStatus["iModelAlreadyExists"] = 102423] = "iModelAlreadyExists";
267
- IModelHubStatus[IModelHubStatus["iModelDoesNotExist"] = 102424] = "iModelDoesNotExist";
268
- IModelHubStatus[IModelHubStatus["FileDoesNotExist"] = 102425] = "FileDoesNotExist";
269
- IModelHubStatus[IModelHubStatus["FileAlreadyExists"] = 102426] = "FileAlreadyExists";
270
- IModelHubStatus[IModelHubStatus["LockDoesNotExist"] = 102427] = "LockDoesNotExist";
271
- IModelHubStatus[IModelHubStatus["LockOwnedByAnotherBriefcase"] = 102428] = "LockOwnedByAnotherBriefcase";
272
- IModelHubStatus[IModelHubStatus["CodeStateInvalid"] = 102429] = "CodeStateInvalid";
273
- IModelHubStatus[IModelHubStatus["CodeReservedByAnotherBriefcase"] = 102430] = "CodeReservedByAnotherBriefcase";
274
- IModelHubStatus[IModelHubStatus["CodeDoesNotExist"] = 102431] = "CodeDoesNotExist";
275
- IModelHubStatus[IModelHubStatus["EventTypeDoesNotExist"] = 102432] = "EventTypeDoesNotExist";
276
- IModelHubStatus[IModelHubStatus["EventSubscriptionDoesNotExist"] = 102433] = "EventSubscriptionDoesNotExist";
277
- IModelHubStatus[IModelHubStatus["EventSubscriptionAlreadyExists"] = 102434] = "EventSubscriptionAlreadyExists";
278
- IModelHubStatus[IModelHubStatus["ITwinIdIsNotSpecified"] = 102435] = "ITwinIdIsNotSpecified";
279
- IModelHubStatus[IModelHubStatus["FailedToGetITwinPermissions"] = 102436] = "FailedToGetITwinPermissions";
280
- IModelHubStatus[IModelHubStatus["FailedToGetITwinMembers"] = 102437] = "FailedToGetITwinMembers";
281
- IModelHubStatus[IModelHubStatus["ChangeSetAlreadyHasVersion"] = 102438] = "ChangeSetAlreadyHasVersion";
282
- IModelHubStatus[IModelHubStatus["VersionAlreadyExists"] = 102439] = "VersionAlreadyExists";
283
- IModelHubStatus[IModelHubStatus["JobSchedulingFailed"] = 102440] = "JobSchedulingFailed";
284
- IModelHubStatus[IModelHubStatus["ConflictsAggregate"] = 102441] = "ConflictsAggregate";
285
- IModelHubStatus[IModelHubStatus["FailedToGetITwinById"] = 102442] = "FailedToGetITwinById";
286
- IModelHubStatus[IModelHubStatus["DatabaseOperationFailed"] = 102443] = "DatabaseOperationFailed";
287
- IModelHubStatus[IModelHubStatus["SeedFileInitializationFailed"] = 102444] = "SeedFileInitializationFailed";
288
- IModelHubStatus[IModelHubStatus["FailedToGetAssetPermissions"] = 102445] = "FailedToGetAssetPermissions";
289
- IModelHubStatus[IModelHubStatus["FailedToGetAssetMembers"] = 102446] = "FailedToGetAssetMembers";
290
- IModelHubStatus[IModelHubStatus["ITwinDoesNotExist"] = 102447] = "ITwinDoesNotExist";
291
- IModelHubStatus[IModelHubStatus["LockChunkDoesNotExist"] = 102449] = "LockChunkDoesNotExist";
292
- IModelHubStatus[IModelHubStatus["CheckpointAlreadyExists"] = 102450] = "CheckpointAlreadyExists";
293
- IModelHubStatus[IModelHubStatus["CheckpointDoesNotExist"] = 102451] = "CheckpointDoesNotExist";
294
- // Errors that are returned for incorrect iModelHub request.
295
- IModelHubStatus[IModelHubStatus["UndefinedArgumentError"] = 102657] = "UndefinedArgumentError";
296
- IModelHubStatus[IModelHubStatus["InvalidArgumentError"] = 102658] = "InvalidArgumentError";
297
- IModelHubStatus[IModelHubStatus["MissingDownloadUrlError"] = 102659] = "MissingDownloadUrlError";
298
- IModelHubStatus[IModelHubStatus["NotSupportedInBrowser"] = 102660] = "NotSupportedInBrowser";
299
- IModelHubStatus[IModelHubStatus["FileHandlerNotSet"] = 102661] = "FileHandlerNotSet";
300
- IModelHubStatus[IModelHubStatus["FileNotFound"] = 102662] = "FileNotFound";
301
- IModelHubStatus[IModelHubStatus["InitializationTimeout"] = 102663] = "InitializationTimeout";
302
- })(IModelHubStatus || (IModelHubStatus = {}));
303
- /** GeoServiceStatus errors
304
- * @public
305
- */
306
- export var GeoServiceStatus;
307
- (function (GeoServiceStatus) {
308
- GeoServiceStatus[GeoServiceStatus["Success"] = 0] = "Success";
309
- GeoServiceStatus[GeoServiceStatus["GEOSERVICESTATUS_BASE"] = 147456] = "GEOSERVICESTATUS_BASE";
310
- // Error mapped from 'IModelStatus'
311
- GeoServiceStatus[GeoServiceStatus["NoGeoLocation"] = 65602] = "NoGeoLocation";
312
- // Following errors are mapped from 'GeoCoordStatus'
313
- GeoServiceStatus[GeoServiceStatus["OutOfUsefulRange"] = 147457] = "OutOfUsefulRange";
314
- GeoServiceStatus[GeoServiceStatus["OutOfMathematicalDomain"] = 147458] = "OutOfMathematicalDomain";
315
- GeoServiceStatus[GeoServiceStatus["NoDatumConverter"] = 147459] = "NoDatumConverter";
316
- GeoServiceStatus[GeoServiceStatus["VerticalDatumConvertError"] = 147460] = "VerticalDatumConvertError";
317
- GeoServiceStatus[GeoServiceStatus["CSMapError"] = 147461] = "CSMapError";
318
- GeoServiceStatus[GeoServiceStatus["Pending"] = 147462] = "Pending";
319
- })(GeoServiceStatus || (GeoServiceStatus = {}));
320
- /** Error status from various reality data operations
321
- * @alpha
322
- */
323
- export var RealityDataStatus;
324
- (function (RealityDataStatus) {
325
- RealityDataStatus[RealityDataStatus["Success"] = 0] = "Success";
326
- RealityDataStatus[RealityDataStatus["REALITYDATA_ERROR_BASE"] = 151552] = "REALITYDATA_ERROR_BASE";
327
- RealityDataStatus[RealityDataStatus["InvalidData"] = 151553] = "InvalidData";
328
- })(RealityDataStatus || (RealityDataStatus = {}));
329
- function isObject(obj) {
330
- return typeof obj === "object" && obj !== null;
331
- }
332
- /** Base exception class for iTwin.js exceptions.
333
- * @public
334
- */
335
- export class BentleyError extends Error {
336
- /**
337
- * @param errorNumber The a number that identifies of the problem.
338
- * @param message message that describes the problem (should not be localized).
339
- * @param metaData metaData about the exception.
340
- */
341
- constructor(errorNumber, message, metaData) {
342
- super(message);
343
- this.errorNumber = errorNumber;
344
- this.errorNumber = errorNumber;
345
- this._metaData = metaData;
346
- this.name = this._initName();
347
- }
348
- /** Returns true if this BentleyError includes (optional) metadata. */
349
- get hasMetaData() { return undefined !== this._metaData; }
350
- /** get the meta data associated with this BentleyError, if any. */
351
- getMetaData() {
352
- return BentleyError.getMetaData(this._metaData);
353
- }
354
- /** get the metadata object associated with an ExceptionMetaData, if any. */
355
- static getMetaData(metaData) {
356
- return (typeof metaData === "function") ? metaData() : metaData;
357
- }
358
- /** This function returns the name of each error status. Override this method to handle more error status codes. */
359
- _initName() {
360
- switch (this.errorNumber) {
361
- case IModelStatus.AlreadyLoaded: return "Already Loaded";
362
- case IModelStatus.AlreadyOpen: return "Already Open";
363
- case IModelStatus.BadArg: return "Bad Arg";
364
- case IModelStatus.BadElement: return "Bad Element";
365
- case IModelStatus.BadModel: return "Bad Model";
366
- case IModelStatus.BadRequest: return "Bad Request";
367
- case IModelStatus.BadSchema: return "Bad Schema";
368
- case IModelStatus.CannotUndo: return "Can not Undo";
369
- case IModelStatus.CodeNotReserved: return "Code Not Reserved";
370
- case IModelStatus.DeletionProhibited: return "Deletion Prohibited";
371
- case IModelStatus.DuplicateCode: return "Duplicate Code";
372
- case IModelStatus.DuplicateName: return "Duplicate Name";
373
- case IModelStatus.ElementBlockedChange: return "Element Blocked Change";
374
- case IModelStatus.FileAlreadyExists: return "File Already Exists";
375
- case IModelStatus.FileNotFound: return "File Not Found";
376
- case IModelStatus.FileNotLoaded: return "File Not Loaded";
377
- case IModelStatus.ForeignKeyConstraint: return "ForeignKey Constraint";
378
- case IModelStatus.IdExists: return "Id Exists";
379
- case IModelStatus.InDynamicTransaction: return "InDynamicTransaction";
380
- case IModelStatus.InvalidCategory: return "Invalid Category";
381
- case IModelStatus.InvalidCode: return "Invalid Code";
382
- case IModelStatus.InvalidCodeSpec: return "Invalid CodeSpec";
383
- case IModelStatus.InvalidId: return "Invalid Id";
384
- case IModelStatus.InvalidName: return "Invalid Name";
385
- case IModelStatus.InvalidParent: return "Invalid Parent";
386
- case IModelStatus.InvalidProfileVersion: return "Invalid Profile Version";
387
- case IModelStatus.IsCreatingChangeSet: return "IsCreatingChangeSet";
388
- case IModelStatus.LockNotHeld: return "Lock Not Held";
389
- case IModelStatus.Mismatch2d3d: return "Mismatch 2d3d";
390
- case IModelStatus.MismatchGcs: return "Mismatch Gcs";
391
- case IModelStatus.MissingDomain: return "Missing Domain";
392
- case IModelStatus.MissingHandler: return "Missing Handler";
393
- case IModelStatus.MissingId: return "Missing Id";
394
- case IModelStatus.NoGeometry: return "No Geometry";
395
- case IModelStatus.NoMultiTxnOperation: return "NoMultiTxnOperation";
396
- case IModelStatus.NotEnabled: return "Not Enabled";
397
- case IModelStatus.NotFound: return "Not Found";
398
- case IModelStatus.NotOpen: return "Not Open";
399
- case IModelStatus.NotOpenForWrite: return "Not Open For Write";
400
- case IModelStatus.NotSameUnitBase: return "Not Same Unit Base";
401
- case IModelStatus.NothingToRedo: return "Nothing To Redo";
402
- case IModelStatus.NothingToUndo: return "Nothing To Undo";
403
- case IModelStatus.ParentBlockedChange: return "Parent Blocked Change";
404
- case IModelStatus.ReadError: return "Read Error";
405
- case IModelStatus.ReadOnly: return "ReadOnly";
406
- case IModelStatus.ReadOnlyDomain: return "ReadOnlyDomain";
407
- case IModelStatus.RepositoryManagerError: return "RepositoryManagerError";
408
- case IModelStatus.SQLiteError: return "SQLiteError";
409
- case IModelStatus.TransactionActive: return "Transaction Active";
410
- case IModelStatus.UnitsMissing: return "Units Missing";
411
- case IModelStatus.UnknownFormat: return "Unknown Format";
412
- case IModelStatus.UpgradeFailed: return "Upgrade Failed";
413
- case IModelStatus.ValidationFailed: return "Validation Failed";
414
- case IModelStatus.VersionTooNew: return "Version Too New";
415
- case IModelStatus.VersionTooOld: return "Version Too Old";
416
- case IModelStatus.ViewNotFound: return "View Not Found";
417
- case IModelStatus.WriteError: return "Write Error";
418
- case IModelStatus.WrongClass: return "Wrong Class";
419
- case IModelStatus.WrongIModel: return "Wrong IModel";
420
- case IModelStatus.WrongDomain: return "Wrong Domain";
421
- case IModelStatus.WrongElement: return "Wrong Element";
422
- case IModelStatus.WrongHandler: return "Wrong Handler";
423
- case IModelStatus.WrongModel: return "Wrong Model";
424
- case DbResult.BE_SQLITE_ERROR: return "BE_SQLITE_ERROR";
425
- case DbResult.BE_SQLITE_INTERNAL: return "BE_SQLITE_INTERNAL";
426
- case DbResult.BE_SQLITE_PERM: return "BE_SQLITE_PERM";
427
- case DbResult.BE_SQLITE_ABORT: return "BE_SQLITE_ABORT";
428
- case DbResult.BE_SQLITE_BUSY: return "Db is busy";
429
- case DbResult.BE_SQLITE_LOCKED: return "Db is Locked";
430
- case DbResult.BE_SQLITE_NOMEM: return "BE_SQLITE_NOMEM";
431
- case DbResult.BE_SQLITE_READONLY: return "Readonly";
432
- case DbResult.BE_SQLITE_INTERRUPT: return "BE_SQLITE_INTERRUPT";
433
- case DbResult.BE_SQLITE_IOERR: return "BE_SQLITE_IOERR";
434
- case DbResult.BE_SQLITE_CORRUPT: return "BE_SQLITE_CORRUPT";
435
- case DbResult.BE_SQLITE_NOTFOUND: return "Not Found";
436
- case DbResult.BE_SQLITE_FULL: return "BE_SQLITE_FULL";
437
- case DbResult.BE_SQLITE_CANTOPEN: return "Can't open";
438
- case DbResult.BE_SQLITE_PROTOCOL: return "BE_SQLITE_PROTOCOL";
439
- case DbResult.BE_SQLITE_EMPTY: return "BE_SQLITE_EMPTY";
440
- case DbResult.BE_SQLITE_SCHEMA: return "BE_SQLITE_SCHEMA";
441
- case DbResult.BE_SQLITE_TOOBIG: return "BE_SQLITE_TOOBIG";
442
- case DbResult.BE_SQLITE_MISMATCH: return "BE_SQLITE_MISMATCH";
443
- case DbResult.BE_SQLITE_MISUSE: return "BE_SQLITE_MISUSE";
444
- case DbResult.BE_SQLITE_NOLFS: return "BE_SQLITE_NOLFS";
445
- case DbResult.BE_SQLITE_AUTH: return "BE_SQLITE_AUTH";
446
- case DbResult.BE_SQLITE_FORMAT: return "BE_SQLITE_FORMAT";
447
- case DbResult.BE_SQLITE_RANGE: return "BE_SQLITE_RANGE";
448
- case DbResult.BE_SQLITE_NOTADB: return "Not a Database";
449
- case DbResult.BE_SQLITE_IOERR_READ: return "BE_SQLITE_IOERR_READ";
450
- case DbResult.BE_SQLITE_IOERR_SHORT_READ: return "BE_SQLITE_IOERR_SHORT_READ";
451
- case DbResult.BE_SQLITE_IOERR_WRITE: return "BE_SQLITE_IOERR_WRITE";
452
- case DbResult.BE_SQLITE_IOERR_FSYNC: return "BE_SQLITE_IOERR_FSYNC";
453
- case DbResult.BE_SQLITE_IOERR_DIR_FSYNC: return "BE_SQLITE_IOERR_DIR_FSYNC";
454
- case DbResult.BE_SQLITE_IOERR_TRUNCATE: return "BE_SQLITE_IOERR_TRUNCATE";
455
- case DbResult.BE_SQLITE_IOERR_FSTAT: return "BE_SQLITE_IOERR_FSTAT";
456
- case DbResult.BE_SQLITE_IOERR_UNLOCK: return "BE_SQLITE_IOERR_UNLOCK";
457
- case DbResult.BE_SQLITE_IOERR_RDLOCK: return "BE_SQLITE_IOERR_RDLOCK";
458
- case DbResult.BE_SQLITE_IOERR_DELETE: return "BE_SQLITE_IOERR_DELETE";
459
- case DbResult.BE_SQLITE_IOERR_BLOCKED: return "BE_SQLITE_IOERR_BLOCKED";
460
- case DbResult.BE_SQLITE_IOERR_NOMEM: return "BE_SQLITE_IOERR_NOMEM";
461
- case DbResult.BE_SQLITE_IOERR_ACCESS: return "BE_SQLITE_IOERR_ACCESS";
462
- case DbResult.BE_SQLITE_IOERR_CHECKRESERVEDLOCK: return "BE_SQLITE_IOERR_CHECKRESERVEDLOCK";
463
- case DbResult.BE_SQLITE_IOERR_LOCK: return "BE_SQLITE_IOERR_LOCK";
464
- case DbResult.BE_SQLITE_IOERR_CLOSE: return "BE_SQLITE_IOERR_CLOSE";
465
- case DbResult.BE_SQLITE_IOERR_DIR_CLOSE: return "BE_SQLITE_IOERR_DIR_CLOSE";
466
- case DbResult.BE_SQLITE_IOERR_SHMOPEN: return "BE_SQLITE_IOERR_SHMOPEN";
467
- case DbResult.BE_SQLITE_IOERR_SHMSIZE: return "BE_SQLITE_IOERR_SHMSIZE";
468
- case DbResult.BE_SQLITE_IOERR_SHMLOCK: return "BE_SQLITE_IOERR_SHMLOCK";
469
- case DbResult.BE_SQLITE_IOERR_SHMMAP: return "BE_SQLITE_IOERR_SHMMAP";
470
- case DbResult.BE_SQLITE_IOERR_SEEK: return "BE_SQLITE_IOERR_SEEK";
471
- case DbResult.BE_SQLITE_IOERR_DELETE_NOENT: return "BE_SQLITE_IOERR_DELETE_NOENT";
472
- case DbResult.BE_SQLITE_ERROR_FileExists: return "File Exists";
473
- case DbResult.BE_SQLITE_ERROR_AlreadyOpen: return "Already Open";
474
- case DbResult.BE_SQLITE_ERROR_NoPropertyTable: return "No Property Table";
475
- case DbResult.BE_SQLITE_ERROR_FileNotFound: return "File Not Found";
476
- case DbResult.BE_SQLITE_ERROR_NoTxnActive: return "No Txn Active";
477
- case DbResult.BE_SQLITE_ERROR_BadDbProfile: return "Bad Db Profile";
478
- case DbResult.BE_SQLITE_ERROR_InvalidProfileVersion: return "Invalid Profile Version";
479
- case DbResult.BE_SQLITE_ERROR_ProfileUpgradeFailed: return "Profile Upgrade Failed";
480
- case DbResult.BE_SQLITE_ERROR_ProfileTooOldForReadWrite: return "Profile Too Old For ReadWrite";
481
- case DbResult.BE_SQLITE_ERROR_ProfileTooOld: return "Profile Too Old";
482
- case DbResult.BE_SQLITE_ERROR_ProfileTooNewForReadWrite: return "Profile Too New For ReadWrite";
483
- case DbResult.BE_SQLITE_ERROR_ProfileTooNew: return "Profile Too New";
484
- case DbResult.BE_SQLITE_ERROR_ChangeTrackError: return "ChangeTrack Error";
485
- case DbResult.BE_SQLITE_ERROR_InvalidChangeSetVersion: return "Invalid ChangeSet Version";
486
- case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRequired: return "Schema Upgrade Required";
487
- case DbResult.BE_SQLITE_ERROR_SchemaTooNew: return "Schema Too New";
488
- case DbResult.BE_SQLITE_ERROR_SchemaTooOld: return "Schema Too Old";
489
- case DbResult.BE_SQLITE_ERROR_SchemaLockFailed: return "Schema Lock Failed";
490
- case DbResult.BE_SQLITE_ERROR_SchemaUpgradeFailed: return "Schema Upgrade Failed";
491
- case DbResult.BE_SQLITE_ERROR_SchemaImportFailed: return "Schema Import Failed";
492
- case DbResult.BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes: return "Could Not Acquire Locks Or Codes";
493
- case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRecommended: return "Recommended that the schemas found in the database be upgraded";
494
- case DbResult.BE_SQLITE_LOCKED_SHAREDCACHE: return "BE_SQLITE_LOCKED_SHAREDCACHE";
495
- case DbResult.BE_SQLITE_BUSY_RECOVERY: return "BE_SQLITE_BUSY_RECOVERY";
496
- case DbResult.BE_SQLITE_CANTOPEN_NOTEMPDIR: return "SQLite No Temp Dir";
497
- case DbResult.BE_SQLITE_CANTOPEN_ISDIR: return "BE_SQLITE_CANTOPEN_ISDIR";
498
- case DbResult.BE_SQLITE_CANTOPEN_FULLPATH: return "BE_SQLITE_CANTOPEN_FULLPATH";
499
- case DbResult.BE_SQLITE_CORRUPT_VTAB: return "BE_SQLITE_CORRUPT_VTAB";
500
- case DbResult.BE_SQLITE_READONLY_RECOVERY: return "BE_SQLITE_READONLY_RECOVERY";
501
- case DbResult.BE_SQLITE_READONLY_CANTLOCK: return "BE_SQLITE_READONLY_CANTLOCK";
502
- case DbResult.BE_SQLITE_READONLY_ROLLBACK: return "BE_SQLITE_READONLY_ROLLBACK";
503
- case DbResult.BE_SQLITE_ABORT_ROLLBACK: return "BE_SQLITE_ABORT_ROLLBACK";
504
- case DbResult.BE_SQLITE_CONSTRAINT_CHECK: return "BE_SQLITE_CONSTRAINT_CHECK";
505
- case DbResult.BE_SQLITE_CONSTRAINT_COMMITHOOK: return "CommitHook Constraint Error";
506
- case DbResult.BE_SQLITE_CONSTRAINT_FOREIGNKEY: return "Foreign Key Constraint Error";
507
- case DbResult.BE_SQLITE_CONSTRAINT_FUNCTION: return "Function Constraint Error";
508
- case DbResult.BE_SQLITE_CONSTRAINT_NOTNULL: return "NotNull Constraint Error";
509
- case DbResult.BE_SQLITE_CONSTRAINT_PRIMARYKEY: return "Primary Key Constraint Error";
510
- case DbResult.BE_SQLITE_CONSTRAINT_TRIGGER: return "Trigger Constraint Error";
511
- case DbResult.BE_SQLITE_CONSTRAINT_UNIQUE: return "Unique Constraint Error";
512
- case DbResult.BE_SQLITE_CONSTRAINT_VTAB: return "VTable Constraint Error";
513
- case BentleyStatus.ERROR: return "Error";
514
- case BriefcaseStatus.CannotAcquire: return "CannotAcquire";
515
- case BriefcaseStatus.CannotDownload: return "CannotDownload";
516
- case BriefcaseStatus.CannotCopy: return "CannotCopy";
517
- case BriefcaseStatus.CannotDelete: return "CannotDelete";
518
- case BriefcaseStatus.VersionNotFound: return "VersionNotFound";
519
- case BriefcaseStatus.DownloadCancelled: return "DownloadCancelled";
520
- case BriefcaseStatus.ContainsDeletedChangeSets: return "ContainsDeletedChangeSets";
521
- case RpcInterfaceStatus.IncompatibleVersion: return "RpcInterfaceStatus.IncompatibleVersion";
522
- case ChangeSetStatus.ApplyError: return "Error applying a change set";
523
- case ChangeSetStatus.ChangeTrackingNotEnabled: return "Change tracking has not been enabled. The ChangeSet API mandates this";
524
- case ChangeSetStatus.CorruptedChangeStream: return "Contents of the change stream are corrupted and does not match the ChangeSet";
525
- case ChangeSetStatus.FileNotFound: return "File containing the changes was not found";
526
- case ChangeSetStatus.FileWriteError: return "Error writing the contents of the change set to the backing change stream file";
527
- case ChangeSetStatus.HasLocalChanges: return "Cannot perform the operation since the Db has local changes";
528
- case ChangeSetStatus.HasUncommittedChanges: return "Cannot perform the operation since current transaction has uncommitted changes";
529
- case ChangeSetStatus.InvalidId: return "Invalid ChangeSet Id";
530
- case ChangeSetStatus.InvalidVersion: return "Invalid version of the change set";
531
- case ChangeSetStatus.InDynamicTransaction: return "Cannot perform the operation since system is in the middle of a dynamic transaction";
532
- case ChangeSetStatus.IsCreatingChangeSet: return "Cannot perform operation since system is in the middle of a creating a change set";
533
- case ChangeSetStatus.IsNotCreatingChangeSet: return "Cannot perform operation since the system is not creating a change set";
534
- case ChangeSetStatus.MergePropagationError: return "Error propagating the changes after the merge";
535
- case ChangeSetStatus.NothingToMerge: return "No change sets to merge";
536
- case ChangeSetStatus.NoTransactions: return "No transactions are available to create a change set";
537
- case ChangeSetStatus.ParentMismatch: return "Parent change set of the Db does not match the parent id of the change set";
538
- case ChangeSetStatus.SQLiteError: return "Error performing a SQLite operation on the Db";
539
- case ChangeSetStatus.WrongDgnDb: return "ChangeSet originated in a different Db";
540
- case ChangeSetStatus.CouldNotOpenDgnDb: return "Could not open the DgnDb to merge change set";
541
- case ChangeSetStatus.MergeSchemaChangesOnOpen: return "Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened";
542
- case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return "Cannot reverse or reinstate schema changes.";
543
- case ChangeSetStatus.ProcessSchemaChangesOnOpen: return "Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened";
544
- case ChangeSetStatus.CannotMergeIntoReadonly: return "Cannot merge changes into a Readonly DgnDb";
545
- case ChangeSetStatus.CannotMergeIntoMaster: return "Cannot merge changes into a Master DgnDb";
546
- case ChangeSetStatus.CannotMergeIntoReversed: return "Cannot merge changes into a DgnDb that has reversed change sets";
547
- case RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
548
- case RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
549
- case RepositoryStatus.SyncError: return "SyncError";
550
- case RepositoryStatus.InvalidResponse: return "InvalidResponse";
551
- case RepositoryStatus.PendingTransactions: return "PendingTransactions";
552
- case RepositoryStatus.LockUsed: return "LockUsed";
553
- case RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
554
- case RepositoryStatus.InvalidRequest: return "InvalidRequest";
555
- case RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
556
- case RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
557
- case RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
558
- case RepositoryStatus.CodeUsed: return "CodeUsed";
559
- case RepositoryStatus.LockNotHeld: return "LockNotHeld";
560
- case RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
561
- case RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
562
- case HttpStatus.Info: return "HTTP Info";
563
- case HttpStatus.Redirection: return "HTTP Redirection";
564
- case HttpStatus.ClientError: return "HTTP Client error";
565
- case HttpStatus.ServerError: return "HTTP Server error";
566
- case IModelHubStatus.Unknown: return "Unknown error";
567
- case IModelHubStatus.MissingRequiredProperties: return "Missing required properties";
568
- case IModelHubStatus.InvalidPropertiesValues: return "Invalid properties values";
569
- case IModelHubStatus.UserDoesNotHavePermission: return "User does not have permission";
570
- case IModelHubStatus.UserDoesNotHaveAccess: return "User does not have access";
571
- case IModelHubStatus.InvalidBriefcase: return "Invalid briefcase";
572
- case IModelHubStatus.BriefcaseDoesNotExist: return "Briefcase does not exist";
573
- case IModelHubStatus.BriefcaseDoesNotBelongToUser: return "Briefcase does not belong to user";
574
- case IModelHubStatus.AnotherUserPushing: return "Another user pushing";
575
- case IModelHubStatus.ChangeSetAlreadyExists: return "ChangeSet already exists";
576
- case IModelHubStatus.ChangeSetDoesNotExist: return "ChangeSet does not exist";
577
- case IModelHubStatus.FileIsNotUploaded: return "File is not uploaded";
578
- case IModelHubStatus.iModelIsNotInitialized: return "iModel is not initialized";
579
- case IModelHubStatus.ChangeSetPointsToBadSeed: return "ChangeSet points to a bad seed file";
580
- case IModelHubStatus.OperationFailed: return "iModelHub operation has failed";
581
- case IModelHubStatus.PullIsRequired: return "Pull is required";
582
- case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return "Limit of briefcases per user was reached";
583
- case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return "Limit of briefcases per user per minute was reached";
584
- case IModelHubStatus.DatabaseTemporarilyLocked: return "Database is temporarily locked";
585
- case IModelHubStatus.iModelIsLocked: return "iModel is locked";
586
- case IModelHubStatus.CodesExist: return "Code already exists";
587
- case IModelHubStatus.LocksExist: return "Lock already exists";
588
- case IModelHubStatus.iModelAlreadyExists: return "iModel already exists";
589
- case IModelHubStatus.iModelDoesNotExist: return "iModel does not exist";
590
- case IModelHubStatus.LockDoesNotExist: return "Lock does not exist";
591
- case IModelHubStatus.LockChunkDoesNotExist: return "Lock chunk does not exist";
592
- case IModelHubStatus.LockOwnedByAnotherBriefcase: return "Lock is owned by another briefcase";
593
- case IModelHubStatus.CodeStateInvalid: return "Code state is invalid";
594
- case IModelHubStatus.CodeReservedByAnotherBriefcase: return "Code is reserved by another briefcase";
595
- case IModelHubStatus.CodeDoesNotExist: return "Code does not exist";
596
- case IModelHubStatus.FileDoesNotExist: return "File does not exist";
597
- case IModelHubStatus.FileAlreadyExists: return "File already exists";
598
- case IModelHubStatus.EventTypeDoesNotExist: return "Event type does not exist";
599
- case IModelHubStatus.EventSubscriptionDoesNotExist: return "Event subscription does not exist";
600
- case IModelHubStatus.EventSubscriptionAlreadyExists: return "Event subscription already exists";
601
- case IModelHubStatus.ITwinIdIsNotSpecified: return "ITwin Id is not specified";
602
- case IModelHubStatus.FailedToGetITwinPermissions: return "Failed to get iTwin permissions";
603
- case IModelHubStatus.FailedToGetITwinMembers: return "Failed to get iTwin members";
604
- case IModelHubStatus.FailedToGetAssetPermissions: return "Failed to get asset permissions";
605
- case IModelHubStatus.FailedToGetAssetMembers: return "Failed to get asset members";
606
- case IModelHubStatus.ChangeSetAlreadyHasVersion: return "ChangeSet already has version";
607
- case IModelHubStatus.VersionAlreadyExists: return "Version already exists";
608
- case IModelHubStatus.JobSchedulingFailed: return "Failed to schedule a background job";
609
- case IModelHubStatus.ConflictsAggregate: return "Codes or locks are owned by another briefcase";
610
- case IModelHubStatus.FailedToGetITwinById: return "Failed to query iTwin by its id";
611
- case IModelHubStatus.DatabaseOperationFailed: return "Database operation has failed";
612
- case IModelHubStatus.ITwinDoesNotExist: return "ITwin does not exist";
613
- case IModelHubStatus.UndefinedArgumentError: return "Undefined argument";
614
- case IModelHubStatus.InvalidArgumentError: return "Invalid argument";
615
- case IModelHubStatus.MissingDownloadUrlError: return "Missing download url";
616
- case IModelHubStatus.NotSupportedInBrowser: return "Not supported in browser";
617
- case IModelHubStatus.FileHandlerNotSet: return "File handler is not set";
618
- case IModelHubStatus.FileNotFound: return "File not found";
619
- case GeoServiceStatus.NoGeoLocation: return "No GeoLocation";
620
- case GeoServiceStatus.OutOfUsefulRange: return "Out of useful range";
621
- case GeoServiceStatus.OutOfMathematicalDomain: return "Out of mathematical domain";
622
- case GeoServiceStatus.NoDatumConverter: return "No datum converter";
623
- case GeoServiceStatus.VerticalDatumConvertError: return "Vertical datum convert error";
624
- case GeoServiceStatus.CSMapError: return "CSMap error";
625
- case GeoServiceStatus.Pending: return "Pending";
626
- case RealityDataStatus.InvalidData: return "Invalid or unknown data";
627
- case IModelStatus.Success:
628
- case DbResult.BE_SQLITE_OK:
629
- case DbResult.BE_SQLITE_ROW:
630
- case DbResult.BE_SQLITE_DONE:
631
- case BentleyStatus.SUCCESS:
632
- return "Success";
633
- default:
634
- return `Error (${this.errorNumber})`;
635
- }
636
- }
637
- /** Use run-time type checking to safely get a useful string summary of an unknown error value, or `""` if none exists.
638
- * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`
639
- * @public
640
- */
641
- static getErrorMessage(error) {
642
- if (typeof error === "string")
643
- return error;
644
- if (error instanceof Error)
645
- return error.toString();
646
- if (isObject(error)) {
647
- if (typeof error.message === "string")
648
- return error.message;
649
- if (typeof error.msg === "string")
650
- return error.msg;
651
- if (error.toString() !== "[object Object]")
652
- return error.toString();
653
- }
654
- return "";
655
- }
656
- /** Use run-time type checking to safely get the call stack of an unknown error value, if possible.
657
- * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`
658
- * @public
659
- */
660
- static getErrorStack(error) {
661
- if (isObject(error) && typeof error.stack === "string")
662
- return error.stack;
663
- return undefined;
664
- }
665
- /** Use run-time type checking to safely get the metadata with an unknown error value, if possible.
666
- * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof BentleyError`
667
- * @see [[BentleyError.getMetaData]]
668
- * @public
669
- */
670
- static getErrorMetadata(error) {
671
- if (isObject(error) && typeof error.getMetaData === "function") {
672
- const metadata = error.getMetaData();
673
- if (typeof metadata === "object" && metadata !== null)
674
- return metadata;
675
- }
676
- return undefined;
677
- }
678
- /** Returns a new `ErrorProps` object representing an unknown error value. Useful for logging or wrapping/re-throwing caught errors.
679
- * @note Unlike `Error` objects (which lose messages and call stacks when serialized to JSON), objects
680
- * returned by this are plain old JavaScript objects, and can be easily logged/serialized to JSON.
681
- * @public
682
- */
683
- static getErrorProps(error) {
684
- const serialized = {
685
- message: BentleyError.getErrorMessage(error),
686
- };
687
- const stack = BentleyError.getErrorStack(error);
688
- if (stack)
689
- serialized.stack = stack;
690
- const metadata = BentleyError.getErrorMetadata(error);
691
- if (metadata)
692
- serialized.metadata = metadata;
693
- return serialized;
694
- }
695
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Errors
7
+ */
8
+ import { DbResult } from "./BeSQLite";
9
+ /** Standard status code.
10
+ * This status code should be rarely used.
11
+ * Prefer to throw an exception to indicate an error, rather than returning a special status code.
12
+ * If a status code is to be returned, prefer to return a more specific error status type such as IModelStatus or DbResult.
13
+ * @public
14
+ */
15
+ export var BentleyStatus;
16
+ (function (BentleyStatus) {
17
+ BentleyStatus[BentleyStatus["SUCCESS"] = 0] = "SUCCESS";
18
+ BentleyStatus[BentleyStatus["ERROR"] = 32768] = "ERROR";
19
+ })(BentleyStatus || (BentleyStatus = {}));
20
+ /** Status codes that are used in conjunction with [[BentleyError]].
21
+ * 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.
22
+ * @public
23
+ */
24
+ export var IModelStatus;
25
+ (function (IModelStatus) {
26
+ IModelStatus[IModelStatus["IMODEL_ERROR_BASE"] = 65536] = "IMODEL_ERROR_BASE";
27
+ IModelStatus[IModelStatus["Success"] = 0] = "Success";
28
+ IModelStatus[IModelStatus["AlreadyLoaded"] = 65537] = "AlreadyLoaded";
29
+ IModelStatus[IModelStatus["AlreadyOpen"] = 65538] = "AlreadyOpen";
30
+ IModelStatus[IModelStatus["BadArg"] = 65539] = "BadArg";
31
+ IModelStatus[IModelStatus["BadElement"] = 65540] = "BadElement";
32
+ IModelStatus[IModelStatus["BadModel"] = 65541] = "BadModel";
33
+ IModelStatus[IModelStatus["BadRequest"] = 65542] = "BadRequest";
34
+ IModelStatus[IModelStatus["BadSchema"] = 65543] = "BadSchema";
35
+ IModelStatus[IModelStatus["CannotUndo"] = 65544] = "CannotUndo";
36
+ IModelStatus[IModelStatus["CodeNotReserved"] = 65545] = "CodeNotReserved";
37
+ IModelStatus[IModelStatus["DeletionProhibited"] = 65546] = "DeletionProhibited";
38
+ IModelStatus[IModelStatus["DuplicateCode"] = 65547] = "DuplicateCode";
39
+ IModelStatus[IModelStatus["DuplicateName"] = 65548] = "DuplicateName";
40
+ IModelStatus[IModelStatus["ElementBlockedChange"] = 65549] = "ElementBlockedChange";
41
+ IModelStatus[IModelStatus["FileAlreadyExists"] = 65550] = "FileAlreadyExists";
42
+ IModelStatus[IModelStatus["FileNotFound"] = 65551] = "FileNotFound";
43
+ IModelStatus[IModelStatus["FileNotLoaded"] = 65552] = "FileNotLoaded";
44
+ IModelStatus[IModelStatus["ForeignKeyConstraint"] = 65553] = "ForeignKeyConstraint";
45
+ IModelStatus[IModelStatus["IdExists"] = 65554] = "IdExists";
46
+ IModelStatus[IModelStatus["InDynamicTransaction"] = 65555] = "InDynamicTransaction";
47
+ IModelStatus[IModelStatus["InvalidCategory"] = 65556] = "InvalidCategory";
48
+ IModelStatus[IModelStatus["InvalidCode"] = 65557] = "InvalidCode";
49
+ IModelStatus[IModelStatus["InvalidCodeSpec"] = 65558] = "InvalidCodeSpec";
50
+ IModelStatus[IModelStatus["InvalidId"] = 65559] = "InvalidId";
51
+ IModelStatus[IModelStatus["InvalidName"] = 65560] = "InvalidName";
52
+ IModelStatus[IModelStatus["InvalidParent"] = 65561] = "InvalidParent";
53
+ IModelStatus[IModelStatus["InvalidProfileVersion"] = 65562] = "InvalidProfileVersion";
54
+ IModelStatus[IModelStatus["IsCreatingChangeSet"] = 65563] = "IsCreatingChangeSet";
55
+ IModelStatus[IModelStatus["LockNotHeld"] = 65564] = "LockNotHeld";
56
+ IModelStatus[IModelStatus["Mismatch2d3d"] = 65565] = "Mismatch2d3d";
57
+ IModelStatus[IModelStatus["MismatchGcs"] = 65566] = "MismatchGcs";
58
+ IModelStatus[IModelStatus["MissingDomain"] = 65567] = "MissingDomain";
59
+ IModelStatus[IModelStatus["MissingHandler"] = 65568] = "MissingHandler";
60
+ IModelStatus[IModelStatus["MissingId"] = 65569] = "MissingId";
61
+ IModelStatus[IModelStatus["NoGeometry"] = 65570] = "NoGeometry";
62
+ IModelStatus[IModelStatus["NoMultiTxnOperation"] = 65571] = "NoMultiTxnOperation";
63
+ IModelStatus[IModelStatus["NotEnabled"] = 65573] = "NotEnabled";
64
+ IModelStatus[IModelStatus["NotFound"] = 65574] = "NotFound";
65
+ IModelStatus[IModelStatus["NotOpen"] = 65575] = "NotOpen";
66
+ IModelStatus[IModelStatus["NotOpenForWrite"] = 65576] = "NotOpenForWrite";
67
+ IModelStatus[IModelStatus["NotSameUnitBase"] = 65577] = "NotSameUnitBase";
68
+ IModelStatus[IModelStatus["NothingToRedo"] = 65578] = "NothingToRedo";
69
+ IModelStatus[IModelStatus["NothingToUndo"] = 65579] = "NothingToUndo";
70
+ IModelStatus[IModelStatus["ParentBlockedChange"] = 65580] = "ParentBlockedChange";
71
+ IModelStatus[IModelStatus["ReadError"] = 65581] = "ReadError";
72
+ IModelStatus[IModelStatus["ReadOnly"] = 65582] = "ReadOnly";
73
+ IModelStatus[IModelStatus["ReadOnlyDomain"] = 65583] = "ReadOnlyDomain";
74
+ IModelStatus[IModelStatus["RepositoryManagerError"] = 65584] = "RepositoryManagerError";
75
+ IModelStatus[IModelStatus["SQLiteError"] = 65585] = "SQLiteError";
76
+ IModelStatus[IModelStatus["TransactionActive"] = 65586] = "TransactionActive";
77
+ IModelStatus[IModelStatus["UnitsMissing"] = 65587] = "UnitsMissing";
78
+ IModelStatus[IModelStatus["UnknownFormat"] = 65588] = "UnknownFormat";
79
+ IModelStatus[IModelStatus["UpgradeFailed"] = 65589] = "UpgradeFailed";
80
+ IModelStatus[IModelStatus["ValidationFailed"] = 65590] = "ValidationFailed";
81
+ IModelStatus[IModelStatus["VersionTooNew"] = 65591] = "VersionTooNew";
82
+ IModelStatus[IModelStatus["VersionTooOld"] = 65592] = "VersionTooOld";
83
+ IModelStatus[IModelStatus["ViewNotFound"] = 65593] = "ViewNotFound";
84
+ IModelStatus[IModelStatus["WriteError"] = 65594] = "WriteError";
85
+ IModelStatus[IModelStatus["WrongClass"] = 65595] = "WrongClass";
86
+ IModelStatus[IModelStatus["WrongIModel"] = 65596] = "WrongIModel";
87
+ IModelStatus[IModelStatus["WrongDomain"] = 65597] = "WrongDomain";
88
+ IModelStatus[IModelStatus["WrongElement"] = 65598] = "WrongElement";
89
+ IModelStatus[IModelStatus["WrongHandler"] = 65599] = "WrongHandler";
90
+ IModelStatus[IModelStatus["WrongModel"] = 65600] = "WrongModel";
91
+ IModelStatus[IModelStatus["ConstraintNotUnique"] = 65601] = "ConstraintNotUnique";
92
+ IModelStatus[IModelStatus["NoGeoLocation"] = 65602] = "NoGeoLocation";
93
+ IModelStatus[IModelStatus["ServerTimeout"] = 65603] = "ServerTimeout";
94
+ IModelStatus[IModelStatus["NoContent"] = 65604] = "NoContent";
95
+ IModelStatus[IModelStatus["NotRegistered"] = 65605] = "NotRegistered";
96
+ IModelStatus[IModelStatus["FunctionNotFound"] = 65606] = "FunctionNotFound";
97
+ IModelStatus[IModelStatus["NoActiveCommand"] = 65607] = "NoActiveCommand";
98
+ })(IModelStatus || (IModelStatus = {}));
99
+ /** Error status from various briefcase operations
100
+ * @beta Should these be internal?
101
+ */
102
+ export var BriefcaseStatus;
103
+ (function (BriefcaseStatus) {
104
+ BriefcaseStatus[BriefcaseStatus["BRIEFCASE_STATUS_BASE"] = 131072] = "BRIEFCASE_STATUS_BASE";
105
+ BriefcaseStatus[BriefcaseStatus["CannotAcquire"] = 131072] = "CannotAcquire";
106
+ BriefcaseStatus[BriefcaseStatus["CannotDownload"] = 131073] = "CannotDownload";
107
+ BriefcaseStatus[BriefcaseStatus["CannotUpload"] = 131074] = "CannotUpload";
108
+ BriefcaseStatus[BriefcaseStatus["CannotCopy"] = 131075] = "CannotCopy";
109
+ BriefcaseStatus[BriefcaseStatus["CannotDelete"] = 131076] = "CannotDelete";
110
+ BriefcaseStatus[BriefcaseStatus["VersionNotFound"] = 131077] = "VersionNotFound";
111
+ BriefcaseStatus[BriefcaseStatus["CannotApplyChanges"] = 131078] = "CannotApplyChanges";
112
+ BriefcaseStatus[BriefcaseStatus["DownloadCancelled"] = 131079] = "DownloadCancelled";
113
+ BriefcaseStatus[BriefcaseStatus["ContainsDeletedChangeSets"] = 131080] = "ContainsDeletedChangeSets";
114
+ })(BriefcaseStatus || (BriefcaseStatus = {}));
115
+ /** RpcInterface status codes
116
+ * @beta Should these be internal?
117
+ */
118
+ export var RpcInterfaceStatus;
119
+ (function (RpcInterfaceStatus) {
120
+ RpcInterfaceStatus[RpcInterfaceStatus["Success"] = 0] = "Success";
121
+ RpcInterfaceStatus[RpcInterfaceStatus["RPC_INTERFACE_ERROR_BASE"] = 135168] = "RPC_INTERFACE_ERROR_BASE";
122
+ /** The RpcInterface implemented by the server is incompatible with the interface requested by the client. */
123
+ RpcInterfaceStatus[RpcInterfaceStatus["IncompatibleVersion"] = 135168] = "IncompatibleVersion";
124
+ })(RpcInterfaceStatus || (RpcInterfaceStatus = {}));
125
+ /** Error status from various Changeset operations
126
+ * @beta Should these be internal?
127
+ */
128
+ export var ChangeSetStatus;
129
+ (function (ChangeSetStatus) {
130
+ ChangeSetStatus[ChangeSetStatus["Success"] = 0] = "Success";
131
+ ChangeSetStatus[ChangeSetStatus["CHANGESET_ERROR_BASE"] = 90112] = "CHANGESET_ERROR_BASE";
132
+ /** Error applying a change set when reversing or reinstating it */
133
+ ChangeSetStatus[ChangeSetStatus["ApplyError"] = 90113] = "ApplyError";
134
+ /** Change tracking has not been enabled. The ChangeSet API mandates this. */
135
+ ChangeSetStatus[ChangeSetStatus["ChangeTrackingNotEnabled"] = 90114] = "ChangeTrackingNotEnabled";
136
+ /** Contents of the change stream are corrupted and does not match the ChangeSet */
137
+ ChangeSetStatus[ChangeSetStatus["CorruptedChangeStream"] = 90115] = "CorruptedChangeStream";
138
+ /** File containing the changes to the change set is not found */
139
+ ChangeSetStatus[ChangeSetStatus["FileNotFound"] = 90116] = "FileNotFound";
140
+ /** Error writing the contents of the change set to the backing change stream file */
141
+ ChangeSetStatus[ChangeSetStatus["FileWriteError"] = 90117] = "FileWriteError";
142
+ /** Cannot perform the operation since the Db has local changes */
143
+ ChangeSetStatus[ChangeSetStatus["HasLocalChanges"] = 90118] = "HasLocalChanges";
144
+ /** Cannot perform the operation since current transaction has uncommitted changes */
145
+ ChangeSetStatus[ChangeSetStatus["HasUncommittedChanges"] = 90119] = "HasUncommittedChanges";
146
+ /** Invalid ChangeSet Id */
147
+ ChangeSetStatus[ChangeSetStatus["InvalidId"] = 90120] = "InvalidId";
148
+ /** Invalid version of the change set */
149
+ ChangeSetStatus[ChangeSetStatus["InvalidVersion"] = 90121] = "InvalidVersion";
150
+ /** Cannot perform the operation since system is in the middle of a dynamic transaction */
151
+ ChangeSetStatus[ChangeSetStatus["InDynamicTransaction"] = 90122] = "InDynamicTransaction";
152
+ /** Cannot perform operation since system is in the middle of a creating a change set */
153
+ ChangeSetStatus[ChangeSetStatus["IsCreatingChangeSet"] = 90123] = "IsCreatingChangeSet";
154
+ /** Cannot perform operation since the system is not creating a change set */
155
+ ChangeSetStatus[ChangeSetStatus["IsNotCreatingChangeSet"] = 90124] = "IsNotCreatingChangeSet";
156
+ /** Error propagating the changes after the merge */
157
+ ChangeSetStatus[ChangeSetStatus["MergePropagationError"] = 90125] = "MergePropagationError";
158
+ /** No change sets to merge */
159
+ ChangeSetStatus[ChangeSetStatus["NothingToMerge"] = 90126] = "NothingToMerge";
160
+ /** No transactions are available to create a change set */
161
+ ChangeSetStatus[ChangeSetStatus["NoTransactions"] = 90127] = "NoTransactions";
162
+ /** Parent change set of the Db does not match the parent id of the change set */
163
+ ChangeSetStatus[ChangeSetStatus["ParentMismatch"] = 90128] = "ParentMismatch";
164
+ /** Error performing a SQLite operation on the Db */
165
+ ChangeSetStatus[ChangeSetStatus["SQLiteError"] = 90129] = "SQLiteError";
166
+ /** ChangeSet originated in a different Db */
167
+ ChangeSetStatus[ChangeSetStatus["WrongDgnDb"] = 90130] = "WrongDgnDb";
168
+ /** Could not open the DgnDb to merge change set */
169
+ ChangeSetStatus[ChangeSetStatus["CouldNotOpenDgnDb"] = 90131] = "CouldNotOpenDgnDb";
170
+ /** Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */
171
+ ChangeSetStatus[ChangeSetStatus["MergeSchemaChangesOnOpen"] = 90132] = "MergeSchemaChangesOnOpen";
172
+ /** Cannot reverse or reinstate schema changes. */
173
+ ChangeSetStatus[ChangeSetStatus["ReverseOrReinstateSchemaChanges"] = 90133] = "ReverseOrReinstateSchemaChanges";
174
+ /** Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened. */
175
+ ChangeSetStatus[ChangeSetStatus["ProcessSchemaChangesOnOpen"] = 90134] = "ProcessSchemaChangesOnOpen";
176
+ /** Cannot merge changes into a Readonly DgnDb. */
177
+ ChangeSetStatus[ChangeSetStatus["CannotMergeIntoReadonly"] = 90135] = "CannotMergeIntoReadonly";
178
+ /** Cannot merge changes into a Master DgnDb. */
179
+ ChangeSetStatus[ChangeSetStatus["CannotMergeIntoMaster"] = 90136] = "CannotMergeIntoMaster";
180
+ /** Cannot merge changes into a DgnDb that has reversed change sets. */
181
+ ChangeSetStatus[ChangeSetStatus["CannotMergeIntoReversed"] = 90137] = "CannotMergeIntoReversed";
182
+ /** ChangeSet(s) download was cancelled. */
183
+ ChangeSetStatus[ChangeSetStatus["DownloadCancelled"] = 90138] = "DownloadCancelled";
184
+ })(ChangeSetStatus || (ChangeSetStatus = {}));
185
+ /** Return codes for methods which perform repository management operations
186
+ * @beta Should these be internal?
187
+ */
188
+ export var RepositoryStatus;
189
+ (function (RepositoryStatus) {
190
+ RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
191
+ /** The repository server did not respond to a request */
192
+ RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
193
+ /** A requested lock was already held by another briefcase */
194
+ RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
195
+ /** Failed to sync briefcase manager with server */
196
+ RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
197
+ /** Response from server not understood */
198
+ RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
199
+ /** An operation requires local changes to be committed or abandoned */
200
+ RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
201
+ /** A lock cannot be relinquished because the associated object has been modified */
202
+ RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
203
+ /** An operation required creation of a ChangeSet, which failed */
204
+ RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
205
+ /** Request to server not understood */
206
+ RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
207
+ /** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
208
+ RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
209
+ /** A requested DgnCode is reserved by another briefcase or in use */
210
+ RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
211
+ /** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
212
+ RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
213
+ /** A DgnCode cannot be relinquished because it has been used locally */
214
+ RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
215
+ /** A required lock is not held by this briefcase */
216
+ RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
217
+ /** Repository is currently locked, no changes allowed */
218
+ RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
219
+ /** Channel write constraint violation, such as an attempt to write outside the designated channel. */
220
+ RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
221
+ })(RepositoryStatus || (RepositoryStatus = {}));
222
+ /** Status from returned HTTP status code
223
+ * @beta Should these be internal?
224
+ */
225
+ export var HttpStatus;
226
+ (function (HttpStatus) {
227
+ /** 2xx Success */
228
+ HttpStatus[HttpStatus["Success"] = 0] = "Success";
229
+ /** 1xx Informational responses */
230
+ HttpStatus[HttpStatus["Info"] = 94209] = "Info";
231
+ /** 3xx Redirection */
232
+ HttpStatus[HttpStatus["Redirection"] = 94210] = "Redirection";
233
+ /** 4xx Client errors */
234
+ HttpStatus[HttpStatus["ClientError"] = 94211] = "ClientError";
235
+ /** 5xx Server errors */
236
+ HttpStatus[HttpStatus["ServerError"] = 94212] = "ServerError";
237
+ })(HttpStatus || (HttpStatus = {}));
238
+ /** iModelHub Services Errors
239
+ * @beta Right package?
240
+ */
241
+ export var IModelHubStatus;
242
+ (function (IModelHubStatus) {
243
+ IModelHubStatus[IModelHubStatus["Success"] = 0] = "Success";
244
+ IModelHubStatus[IModelHubStatus["IMODELHUBERROR_BASE"] = 102400] = "IMODELHUBERROR_BASE";
245
+ IModelHubStatus[IModelHubStatus["IMODELHUBERROR_REQUESTERRORBASE"] = 102656] = "IMODELHUBERROR_REQUESTERRORBASE";
246
+ IModelHubStatus[IModelHubStatus["Unknown"] = 102401] = "Unknown";
247
+ IModelHubStatus[IModelHubStatus["MissingRequiredProperties"] = 102402] = "MissingRequiredProperties";
248
+ IModelHubStatus[IModelHubStatus["InvalidPropertiesValues"] = 102403] = "InvalidPropertiesValues";
249
+ IModelHubStatus[IModelHubStatus["UserDoesNotHavePermission"] = 102404] = "UserDoesNotHavePermission";
250
+ IModelHubStatus[IModelHubStatus["UserDoesNotHaveAccess"] = 102405] = "UserDoesNotHaveAccess";
251
+ IModelHubStatus[IModelHubStatus["InvalidBriefcase"] = 102406] = "InvalidBriefcase";
252
+ IModelHubStatus[IModelHubStatus["BriefcaseDoesNotExist"] = 102407] = "BriefcaseDoesNotExist";
253
+ IModelHubStatus[IModelHubStatus["BriefcaseDoesNotBelongToUser"] = 102408] = "BriefcaseDoesNotBelongToUser";
254
+ IModelHubStatus[IModelHubStatus["AnotherUserPushing"] = 102409] = "AnotherUserPushing";
255
+ IModelHubStatus[IModelHubStatus["ChangeSetAlreadyExists"] = 102410] = "ChangeSetAlreadyExists";
256
+ IModelHubStatus[IModelHubStatus["ChangeSetDoesNotExist"] = 102411] = "ChangeSetDoesNotExist";
257
+ IModelHubStatus[IModelHubStatus["FileIsNotUploaded"] = 102412] = "FileIsNotUploaded";
258
+ IModelHubStatus[IModelHubStatus["iModelIsNotInitialized"] = 102413] = "iModelIsNotInitialized";
259
+ IModelHubStatus[IModelHubStatus["ChangeSetPointsToBadSeed"] = 102414] = "ChangeSetPointsToBadSeed";
260
+ IModelHubStatus[IModelHubStatus["OperationFailed"] = 102415] = "OperationFailed";
261
+ IModelHubStatus[IModelHubStatus["PullIsRequired"] = 102416] = "PullIsRequired";
262
+ IModelHubStatus[IModelHubStatus["MaximumNumberOfBriefcasesPerUser"] = 102417] = "MaximumNumberOfBriefcasesPerUser";
263
+ IModelHubStatus[IModelHubStatus["MaximumNumberOfBriefcasesPerUserPerMinute"] = 102418] = "MaximumNumberOfBriefcasesPerUserPerMinute";
264
+ IModelHubStatus[IModelHubStatus["DatabaseTemporarilyLocked"] = 102419] = "DatabaseTemporarilyLocked";
265
+ IModelHubStatus[IModelHubStatus["iModelIsLocked"] = 102420] = "iModelIsLocked";
266
+ IModelHubStatus[IModelHubStatus["CodesExist"] = 102421] = "CodesExist";
267
+ IModelHubStatus[IModelHubStatus["LocksExist"] = 102422] = "LocksExist";
268
+ IModelHubStatus[IModelHubStatus["iModelAlreadyExists"] = 102423] = "iModelAlreadyExists";
269
+ IModelHubStatus[IModelHubStatus["iModelDoesNotExist"] = 102424] = "iModelDoesNotExist";
270
+ IModelHubStatus[IModelHubStatus["FileDoesNotExist"] = 102425] = "FileDoesNotExist";
271
+ IModelHubStatus[IModelHubStatus["FileAlreadyExists"] = 102426] = "FileAlreadyExists";
272
+ IModelHubStatus[IModelHubStatus["LockDoesNotExist"] = 102427] = "LockDoesNotExist";
273
+ IModelHubStatus[IModelHubStatus["LockOwnedByAnotherBriefcase"] = 102428] = "LockOwnedByAnotherBriefcase";
274
+ IModelHubStatus[IModelHubStatus["CodeStateInvalid"] = 102429] = "CodeStateInvalid";
275
+ IModelHubStatus[IModelHubStatus["CodeReservedByAnotherBriefcase"] = 102430] = "CodeReservedByAnotherBriefcase";
276
+ IModelHubStatus[IModelHubStatus["CodeDoesNotExist"] = 102431] = "CodeDoesNotExist";
277
+ IModelHubStatus[IModelHubStatus["EventTypeDoesNotExist"] = 102432] = "EventTypeDoesNotExist";
278
+ IModelHubStatus[IModelHubStatus["EventSubscriptionDoesNotExist"] = 102433] = "EventSubscriptionDoesNotExist";
279
+ IModelHubStatus[IModelHubStatus["EventSubscriptionAlreadyExists"] = 102434] = "EventSubscriptionAlreadyExists";
280
+ IModelHubStatus[IModelHubStatus["ITwinIdIsNotSpecified"] = 102435] = "ITwinIdIsNotSpecified";
281
+ IModelHubStatus[IModelHubStatus["FailedToGetITwinPermissions"] = 102436] = "FailedToGetITwinPermissions";
282
+ IModelHubStatus[IModelHubStatus["FailedToGetITwinMembers"] = 102437] = "FailedToGetITwinMembers";
283
+ IModelHubStatus[IModelHubStatus["ChangeSetAlreadyHasVersion"] = 102438] = "ChangeSetAlreadyHasVersion";
284
+ IModelHubStatus[IModelHubStatus["VersionAlreadyExists"] = 102439] = "VersionAlreadyExists";
285
+ IModelHubStatus[IModelHubStatus["JobSchedulingFailed"] = 102440] = "JobSchedulingFailed";
286
+ IModelHubStatus[IModelHubStatus["ConflictsAggregate"] = 102441] = "ConflictsAggregate";
287
+ IModelHubStatus[IModelHubStatus["FailedToGetITwinById"] = 102442] = "FailedToGetITwinById";
288
+ IModelHubStatus[IModelHubStatus["DatabaseOperationFailed"] = 102443] = "DatabaseOperationFailed";
289
+ IModelHubStatus[IModelHubStatus["SeedFileInitializationFailed"] = 102444] = "SeedFileInitializationFailed";
290
+ IModelHubStatus[IModelHubStatus["FailedToGetAssetPermissions"] = 102445] = "FailedToGetAssetPermissions";
291
+ IModelHubStatus[IModelHubStatus["FailedToGetAssetMembers"] = 102446] = "FailedToGetAssetMembers";
292
+ IModelHubStatus[IModelHubStatus["ITwinDoesNotExist"] = 102447] = "ITwinDoesNotExist";
293
+ IModelHubStatus[IModelHubStatus["LockChunkDoesNotExist"] = 102449] = "LockChunkDoesNotExist";
294
+ IModelHubStatus[IModelHubStatus["CheckpointAlreadyExists"] = 102450] = "CheckpointAlreadyExists";
295
+ IModelHubStatus[IModelHubStatus["CheckpointDoesNotExist"] = 102451] = "CheckpointDoesNotExist";
296
+ // Errors that are returned for incorrect iModelHub request.
297
+ IModelHubStatus[IModelHubStatus["UndefinedArgumentError"] = 102657] = "UndefinedArgumentError";
298
+ IModelHubStatus[IModelHubStatus["InvalidArgumentError"] = 102658] = "InvalidArgumentError";
299
+ IModelHubStatus[IModelHubStatus["MissingDownloadUrlError"] = 102659] = "MissingDownloadUrlError";
300
+ IModelHubStatus[IModelHubStatus["NotSupportedInBrowser"] = 102660] = "NotSupportedInBrowser";
301
+ IModelHubStatus[IModelHubStatus["FileHandlerNotSet"] = 102661] = "FileHandlerNotSet";
302
+ IModelHubStatus[IModelHubStatus["FileNotFound"] = 102662] = "FileNotFound";
303
+ IModelHubStatus[IModelHubStatus["InitializationTimeout"] = 102663] = "InitializationTimeout";
304
+ })(IModelHubStatus || (IModelHubStatus = {}));
305
+ /** GeoServiceStatus errors
306
+ * @public
307
+ */
308
+ export var GeoServiceStatus;
309
+ (function (GeoServiceStatus) {
310
+ GeoServiceStatus[GeoServiceStatus["Success"] = 0] = "Success";
311
+ GeoServiceStatus[GeoServiceStatus["GEOSERVICESTATUS_BASE"] = 147456] = "GEOSERVICESTATUS_BASE";
312
+ // Error mapped from 'IModelStatus'
313
+ GeoServiceStatus[GeoServiceStatus["NoGeoLocation"] = 65602] = "NoGeoLocation";
314
+ // Following errors are mapped from 'GeoCoordStatus'
315
+ GeoServiceStatus[GeoServiceStatus["OutOfUsefulRange"] = 147457] = "OutOfUsefulRange";
316
+ GeoServiceStatus[GeoServiceStatus["OutOfMathematicalDomain"] = 147458] = "OutOfMathematicalDomain";
317
+ GeoServiceStatus[GeoServiceStatus["NoDatumConverter"] = 147459] = "NoDatumConverter";
318
+ GeoServiceStatus[GeoServiceStatus["VerticalDatumConvertError"] = 147460] = "VerticalDatumConvertError";
319
+ GeoServiceStatus[GeoServiceStatus["CSMapError"] = 147461] = "CSMapError";
320
+ GeoServiceStatus[GeoServiceStatus["Pending"] = 147462] = "Pending";
321
+ })(GeoServiceStatus || (GeoServiceStatus = {}));
322
+ /** Error status from various reality data operations
323
+ * @alpha
324
+ */
325
+ export var RealityDataStatus;
326
+ (function (RealityDataStatus) {
327
+ RealityDataStatus[RealityDataStatus["Success"] = 0] = "Success";
328
+ RealityDataStatus[RealityDataStatus["REALITYDATA_ERROR_BASE"] = 151552] = "REALITYDATA_ERROR_BASE";
329
+ RealityDataStatus[RealityDataStatus["InvalidData"] = 151553] = "InvalidData";
330
+ })(RealityDataStatus || (RealityDataStatus = {}));
331
+ function isObject(obj) {
332
+ return typeof obj === "object" && obj !== null;
333
+ }
334
+ /** Base exception class for iTwin.js exceptions.
335
+ * @public
336
+ */
337
+ export class BentleyError extends Error {
338
+ /**
339
+ * @param errorNumber The a number that identifies of the problem.
340
+ * @param message message that describes the problem (should not be localized).
341
+ * @param metaData metaData about the exception.
342
+ */
343
+ constructor(errorNumber, message, metaData) {
344
+ super(message);
345
+ this.errorNumber = errorNumber;
346
+ this.errorNumber = errorNumber;
347
+ this._metaData = metaData;
348
+ this.name = this._initName();
349
+ }
350
+ /** Returns true if this BentleyError includes (optional) metadata. */
351
+ get hasMetaData() { return undefined !== this._metaData; }
352
+ /** get the meta data associated with this BentleyError, if any. */
353
+ getMetaData() {
354
+ return BentleyError.getMetaData(this._metaData);
355
+ }
356
+ /** get the metadata object associated with an ExceptionMetaData, if any. */
357
+ static getMetaData(metaData) {
358
+ return (typeof metaData === "function") ? metaData() : metaData;
359
+ }
360
+ /** This function returns the name of each error status. Override this method to handle more error status codes. */
361
+ _initName() {
362
+ switch (this.errorNumber) {
363
+ case IModelStatus.AlreadyLoaded: return "Already Loaded";
364
+ case IModelStatus.AlreadyOpen: return "Already Open";
365
+ case IModelStatus.BadArg: return "Bad Arg";
366
+ case IModelStatus.BadElement: return "Bad Element";
367
+ case IModelStatus.BadModel: return "Bad Model";
368
+ case IModelStatus.BadRequest: return "Bad Request";
369
+ case IModelStatus.BadSchema: return "Bad Schema";
370
+ case IModelStatus.CannotUndo: return "Can not Undo";
371
+ case IModelStatus.CodeNotReserved: return "Code Not Reserved";
372
+ case IModelStatus.DeletionProhibited: return "Deletion Prohibited";
373
+ case IModelStatus.DuplicateCode: return "Duplicate Code";
374
+ case IModelStatus.DuplicateName: return "Duplicate Name";
375
+ case IModelStatus.ElementBlockedChange: return "Element Blocked Change";
376
+ case IModelStatus.FileAlreadyExists: return "File Already Exists";
377
+ case IModelStatus.FileNotFound: return "File Not Found";
378
+ case IModelStatus.FileNotLoaded: return "File Not Loaded";
379
+ case IModelStatus.ForeignKeyConstraint: return "ForeignKey Constraint";
380
+ case IModelStatus.IdExists: return "Id Exists";
381
+ case IModelStatus.InDynamicTransaction: return "InDynamicTransaction";
382
+ case IModelStatus.InvalidCategory: return "Invalid Category";
383
+ case IModelStatus.InvalidCode: return "Invalid Code";
384
+ case IModelStatus.InvalidCodeSpec: return "Invalid CodeSpec";
385
+ case IModelStatus.InvalidId: return "Invalid Id";
386
+ case IModelStatus.InvalidName: return "Invalid Name";
387
+ case IModelStatus.InvalidParent: return "Invalid Parent";
388
+ case IModelStatus.InvalidProfileVersion: return "Invalid Profile Version";
389
+ case IModelStatus.IsCreatingChangeSet: return "IsCreatingChangeSet";
390
+ case IModelStatus.LockNotHeld: return "Lock Not Held";
391
+ case IModelStatus.Mismatch2d3d: return "Mismatch 2d3d";
392
+ case IModelStatus.MismatchGcs: return "Mismatch Gcs";
393
+ case IModelStatus.MissingDomain: return "Missing Domain";
394
+ case IModelStatus.MissingHandler: return "Missing Handler";
395
+ case IModelStatus.MissingId: return "Missing Id";
396
+ case IModelStatus.NoGeometry: return "No Geometry";
397
+ case IModelStatus.NoMultiTxnOperation: return "NoMultiTxnOperation";
398
+ case IModelStatus.NotEnabled: return "Not Enabled";
399
+ case IModelStatus.NotFound: return "Not Found";
400
+ case IModelStatus.NotOpen: return "Not Open";
401
+ case IModelStatus.NotOpenForWrite: return "Not Open For Write";
402
+ case IModelStatus.NotSameUnitBase: return "Not Same Unit Base";
403
+ case IModelStatus.NothingToRedo: return "Nothing To Redo";
404
+ case IModelStatus.NothingToUndo: return "Nothing To Undo";
405
+ case IModelStatus.ParentBlockedChange: return "Parent Blocked Change";
406
+ case IModelStatus.ReadError: return "Read Error";
407
+ case IModelStatus.ReadOnly: return "ReadOnly";
408
+ case IModelStatus.ReadOnlyDomain: return "ReadOnlyDomain";
409
+ case IModelStatus.RepositoryManagerError: return "RepositoryManagerError";
410
+ case IModelStatus.SQLiteError: return "SQLiteError";
411
+ case IModelStatus.TransactionActive: return "Transaction Active";
412
+ case IModelStatus.UnitsMissing: return "Units Missing";
413
+ case IModelStatus.UnknownFormat: return "Unknown Format";
414
+ case IModelStatus.UpgradeFailed: return "Upgrade Failed";
415
+ case IModelStatus.ValidationFailed: return "Validation Failed";
416
+ case IModelStatus.VersionTooNew: return "Version Too New";
417
+ case IModelStatus.VersionTooOld: return "Version Too Old";
418
+ case IModelStatus.ViewNotFound: return "View Not Found";
419
+ case IModelStatus.WriteError: return "Write Error";
420
+ case IModelStatus.WrongClass: return "Wrong Class";
421
+ case IModelStatus.WrongIModel: return "Wrong IModel";
422
+ case IModelStatus.WrongDomain: return "Wrong Domain";
423
+ case IModelStatus.WrongElement: return "Wrong Element";
424
+ case IModelStatus.WrongHandler: return "Wrong Handler";
425
+ case IModelStatus.WrongModel: return "Wrong Model";
426
+ case DbResult.BE_SQLITE_ERROR: return "BE_SQLITE_ERROR";
427
+ case DbResult.BE_SQLITE_INTERNAL: return "BE_SQLITE_INTERNAL";
428
+ case DbResult.BE_SQLITE_PERM: return "BE_SQLITE_PERM";
429
+ case DbResult.BE_SQLITE_ABORT: return "BE_SQLITE_ABORT";
430
+ case DbResult.BE_SQLITE_BUSY: return "Db is busy";
431
+ case DbResult.BE_SQLITE_LOCKED: return "Db is Locked";
432
+ case DbResult.BE_SQLITE_NOMEM: return "BE_SQLITE_NOMEM";
433
+ case DbResult.BE_SQLITE_READONLY: return "Readonly";
434
+ case DbResult.BE_SQLITE_INTERRUPT: return "BE_SQLITE_INTERRUPT";
435
+ case DbResult.BE_SQLITE_IOERR: return "BE_SQLITE_IOERR";
436
+ case DbResult.BE_SQLITE_CORRUPT: return "BE_SQLITE_CORRUPT";
437
+ case DbResult.BE_SQLITE_NOTFOUND: return "Not Found";
438
+ case DbResult.BE_SQLITE_FULL: return "BE_SQLITE_FULL";
439
+ case DbResult.BE_SQLITE_CANTOPEN: return "Can't open";
440
+ case DbResult.BE_SQLITE_PROTOCOL: return "BE_SQLITE_PROTOCOL";
441
+ case DbResult.BE_SQLITE_EMPTY: return "BE_SQLITE_EMPTY";
442
+ case DbResult.BE_SQLITE_SCHEMA: return "BE_SQLITE_SCHEMA";
443
+ case DbResult.BE_SQLITE_TOOBIG: return "BE_SQLITE_TOOBIG";
444
+ case DbResult.BE_SQLITE_MISMATCH: return "BE_SQLITE_MISMATCH";
445
+ case DbResult.BE_SQLITE_MISUSE: return "BE_SQLITE_MISUSE";
446
+ case DbResult.BE_SQLITE_NOLFS: return "BE_SQLITE_NOLFS";
447
+ case DbResult.BE_SQLITE_AUTH: return "BE_SQLITE_AUTH";
448
+ case DbResult.BE_SQLITE_FORMAT: return "BE_SQLITE_FORMAT";
449
+ case DbResult.BE_SQLITE_RANGE: return "BE_SQLITE_RANGE";
450
+ case DbResult.BE_SQLITE_NOTADB: return "Not a Database";
451
+ case DbResult.BE_SQLITE_IOERR_READ: return "BE_SQLITE_IOERR_READ";
452
+ case DbResult.BE_SQLITE_IOERR_SHORT_READ: return "BE_SQLITE_IOERR_SHORT_READ";
453
+ case DbResult.BE_SQLITE_IOERR_WRITE: return "BE_SQLITE_IOERR_WRITE";
454
+ case DbResult.BE_SQLITE_IOERR_FSYNC: return "BE_SQLITE_IOERR_FSYNC";
455
+ case DbResult.BE_SQLITE_IOERR_DIR_FSYNC: return "BE_SQLITE_IOERR_DIR_FSYNC";
456
+ case DbResult.BE_SQLITE_IOERR_TRUNCATE: return "BE_SQLITE_IOERR_TRUNCATE";
457
+ case DbResult.BE_SQLITE_IOERR_FSTAT: return "BE_SQLITE_IOERR_FSTAT";
458
+ case DbResult.BE_SQLITE_IOERR_UNLOCK: return "BE_SQLITE_IOERR_UNLOCK";
459
+ case DbResult.BE_SQLITE_IOERR_RDLOCK: return "BE_SQLITE_IOERR_RDLOCK";
460
+ case DbResult.BE_SQLITE_IOERR_DELETE: return "BE_SQLITE_IOERR_DELETE";
461
+ case DbResult.BE_SQLITE_IOERR_BLOCKED: return "BE_SQLITE_IOERR_BLOCKED";
462
+ case DbResult.BE_SQLITE_IOERR_NOMEM: return "BE_SQLITE_IOERR_NOMEM";
463
+ case DbResult.BE_SQLITE_IOERR_ACCESS: return "BE_SQLITE_IOERR_ACCESS";
464
+ case DbResult.BE_SQLITE_IOERR_CHECKRESERVEDLOCK: return "BE_SQLITE_IOERR_CHECKRESERVEDLOCK";
465
+ case DbResult.BE_SQLITE_IOERR_LOCK: return "BE_SQLITE_IOERR_LOCK";
466
+ case DbResult.BE_SQLITE_IOERR_CLOSE: return "BE_SQLITE_IOERR_CLOSE";
467
+ case DbResult.BE_SQLITE_IOERR_DIR_CLOSE: return "BE_SQLITE_IOERR_DIR_CLOSE";
468
+ case DbResult.BE_SQLITE_IOERR_SHMOPEN: return "BE_SQLITE_IOERR_SHMOPEN";
469
+ case DbResult.BE_SQLITE_IOERR_SHMSIZE: return "BE_SQLITE_IOERR_SHMSIZE";
470
+ case DbResult.BE_SQLITE_IOERR_SHMLOCK: return "BE_SQLITE_IOERR_SHMLOCK";
471
+ case DbResult.BE_SQLITE_IOERR_SHMMAP: return "BE_SQLITE_IOERR_SHMMAP";
472
+ case DbResult.BE_SQLITE_IOERR_SEEK: return "BE_SQLITE_IOERR_SEEK";
473
+ case DbResult.BE_SQLITE_IOERR_DELETE_NOENT: return "BE_SQLITE_IOERR_DELETE_NOENT";
474
+ case DbResult.BE_SQLITE_ERROR_FileExists: return "File Exists";
475
+ case DbResult.BE_SQLITE_ERROR_AlreadyOpen: return "Already Open";
476
+ case DbResult.BE_SQLITE_ERROR_NoPropertyTable: return "No Property Table";
477
+ case DbResult.BE_SQLITE_ERROR_FileNotFound: return "File Not Found";
478
+ case DbResult.BE_SQLITE_ERROR_NoTxnActive: return "No Txn Active";
479
+ case DbResult.BE_SQLITE_ERROR_BadDbProfile: return "Bad Db Profile";
480
+ case DbResult.BE_SQLITE_ERROR_InvalidProfileVersion: return "Invalid Profile Version";
481
+ case DbResult.BE_SQLITE_ERROR_ProfileUpgradeFailed: return "Profile Upgrade Failed";
482
+ case DbResult.BE_SQLITE_ERROR_ProfileTooOldForReadWrite: return "Profile Too Old For ReadWrite";
483
+ case DbResult.BE_SQLITE_ERROR_ProfileTooOld: return "Profile Too Old";
484
+ case DbResult.BE_SQLITE_ERROR_ProfileTooNewForReadWrite: return "Profile Too New For ReadWrite";
485
+ case DbResult.BE_SQLITE_ERROR_ProfileTooNew: return "Profile Too New";
486
+ case DbResult.BE_SQLITE_ERROR_ChangeTrackError: return "ChangeTrack Error";
487
+ case DbResult.BE_SQLITE_ERROR_InvalidChangeSetVersion: return "Invalid ChangeSet Version";
488
+ case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRequired: return "Schema Upgrade Required";
489
+ case DbResult.BE_SQLITE_ERROR_SchemaTooNew: return "Schema Too New";
490
+ case DbResult.BE_SQLITE_ERROR_SchemaTooOld: return "Schema Too Old";
491
+ case DbResult.BE_SQLITE_ERROR_SchemaLockFailed: return "Schema Lock Failed";
492
+ case DbResult.BE_SQLITE_ERROR_SchemaUpgradeFailed: return "Schema Upgrade Failed";
493
+ case DbResult.BE_SQLITE_ERROR_SchemaImportFailed: return "Schema Import Failed";
494
+ case DbResult.BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes: return "Could Not Acquire Locks Or Codes";
495
+ case DbResult.BE_SQLITE_ERROR_SchemaUpgradeRecommended: return "Recommended that the schemas found in the database be upgraded";
496
+ case DbResult.BE_SQLITE_LOCKED_SHAREDCACHE: return "BE_SQLITE_LOCKED_SHAREDCACHE";
497
+ case DbResult.BE_SQLITE_BUSY_RECOVERY: return "BE_SQLITE_BUSY_RECOVERY";
498
+ case DbResult.BE_SQLITE_CANTOPEN_NOTEMPDIR: return "SQLite No Temp Dir";
499
+ case DbResult.BE_SQLITE_CANTOPEN_ISDIR: return "BE_SQLITE_CANTOPEN_ISDIR";
500
+ case DbResult.BE_SQLITE_CANTOPEN_FULLPATH: return "BE_SQLITE_CANTOPEN_FULLPATH";
501
+ case DbResult.BE_SQLITE_CORRUPT_VTAB: return "BE_SQLITE_CORRUPT_VTAB";
502
+ case DbResult.BE_SQLITE_READONLY_RECOVERY: return "BE_SQLITE_READONLY_RECOVERY";
503
+ case DbResult.BE_SQLITE_READONLY_CANTLOCK: return "BE_SQLITE_READONLY_CANTLOCK";
504
+ case DbResult.BE_SQLITE_READONLY_ROLLBACK: return "BE_SQLITE_READONLY_ROLLBACK";
505
+ case DbResult.BE_SQLITE_ABORT_ROLLBACK: return "BE_SQLITE_ABORT_ROLLBACK";
506
+ case DbResult.BE_SQLITE_CONSTRAINT_CHECK: return "BE_SQLITE_CONSTRAINT_CHECK";
507
+ case DbResult.BE_SQLITE_CONSTRAINT_COMMITHOOK: return "CommitHook Constraint Error";
508
+ case DbResult.BE_SQLITE_CONSTRAINT_FOREIGNKEY: return "Foreign Key Constraint Error";
509
+ case DbResult.BE_SQLITE_CONSTRAINT_FUNCTION: return "Function Constraint Error";
510
+ case DbResult.BE_SQLITE_CONSTRAINT_NOTNULL: return "NotNull Constraint Error";
511
+ case DbResult.BE_SQLITE_CONSTRAINT_PRIMARYKEY: return "Primary Key Constraint Error";
512
+ case DbResult.BE_SQLITE_CONSTRAINT_TRIGGER: return "Trigger Constraint Error";
513
+ case DbResult.BE_SQLITE_CONSTRAINT_UNIQUE: return "Unique Constraint Error";
514
+ case DbResult.BE_SQLITE_CONSTRAINT_VTAB: return "VTable Constraint Error";
515
+ case BentleyStatus.ERROR: return "Error";
516
+ case BriefcaseStatus.CannotAcquire: return "CannotAcquire";
517
+ case BriefcaseStatus.CannotDownload: return "CannotDownload";
518
+ case BriefcaseStatus.CannotCopy: return "CannotCopy";
519
+ case BriefcaseStatus.CannotDelete: return "CannotDelete";
520
+ case BriefcaseStatus.VersionNotFound: return "VersionNotFound";
521
+ case BriefcaseStatus.DownloadCancelled: return "DownloadCancelled";
522
+ case BriefcaseStatus.ContainsDeletedChangeSets: return "ContainsDeletedChangeSets";
523
+ case RpcInterfaceStatus.IncompatibleVersion: return "RpcInterfaceStatus.IncompatibleVersion";
524
+ case ChangeSetStatus.ApplyError: return "Error applying a change set";
525
+ case ChangeSetStatus.ChangeTrackingNotEnabled: return "Change tracking has not been enabled. The ChangeSet API mandates this";
526
+ case ChangeSetStatus.CorruptedChangeStream: return "Contents of the change stream are corrupted and does not match the ChangeSet";
527
+ case ChangeSetStatus.FileNotFound: return "File containing the changes was not found";
528
+ case ChangeSetStatus.FileWriteError: return "Error writing the contents of the change set to the backing change stream file";
529
+ case ChangeSetStatus.HasLocalChanges: return "Cannot perform the operation since the Db has local changes";
530
+ case ChangeSetStatus.HasUncommittedChanges: return "Cannot perform the operation since current transaction has uncommitted changes";
531
+ case ChangeSetStatus.InvalidId: return "Invalid ChangeSet Id";
532
+ case ChangeSetStatus.InvalidVersion: return "Invalid version of the change set";
533
+ case ChangeSetStatus.InDynamicTransaction: return "Cannot perform the operation since system is in the middle of a dynamic transaction";
534
+ case ChangeSetStatus.IsCreatingChangeSet: return "Cannot perform operation since system is in the middle of a creating a change set";
535
+ case ChangeSetStatus.IsNotCreatingChangeSet: return "Cannot perform operation since the system is not creating a change set";
536
+ case ChangeSetStatus.MergePropagationError: return "Error propagating the changes after the merge";
537
+ case ChangeSetStatus.NothingToMerge: return "No change sets to merge";
538
+ case ChangeSetStatus.NoTransactions: return "No transactions are available to create a change set";
539
+ case ChangeSetStatus.ParentMismatch: return "Parent change set of the Db does not match the parent id of the change set";
540
+ case ChangeSetStatus.SQLiteError: return "Error performing a SQLite operation on the Db";
541
+ case ChangeSetStatus.WrongDgnDb: return "ChangeSet originated in a different Db";
542
+ case ChangeSetStatus.CouldNotOpenDgnDb: return "Could not open the DgnDb to merge change set";
543
+ case ChangeSetStatus.MergeSchemaChangesOnOpen: return "Cannot merge changes in in an open DgnDb. Close the DgnDb, and process the operation when it is opened";
544
+ case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return "Cannot reverse or reinstate schema changes.";
545
+ case ChangeSetStatus.ProcessSchemaChangesOnOpen: return "Cannot process changes schema changes in an open DgnDb. Close the DgnDb, and process the operation when it is opened";
546
+ case ChangeSetStatus.CannotMergeIntoReadonly: return "Cannot merge changes into a Readonly DgnDb";
547
+ case ChangeSetStatus.CannotMergeIntoMaster: return "Cannot merge changes into a Master DgnDb";
548
+ case ChangeSetStatus.CannotMergeIntoReversed: return "Cannot merge changes into a DgnDb that has reversed change sets";
549
+ case ChangeSetStatus.DownloadCancelled: return "ChangeSet(s) download was cancelled.";
550
+ case RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
551
+ case RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
552
+ case RepositoryStatus.SyncError: return "SyncError";
553
+ case RepositoryStatus.InvalidResponse: return "InvalidResponse";
554
+ case RepositoryStatus.PendingTransactions: return "PendingTransactions";
555
+ case RepositoryStatus.LockUsed: return "LockUsed";
556
+ case RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
557
+ case RepositoryStatus.InvalidRequest: return "InvalidRequest";
558
+ case RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
559
+ case RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
560
+ case RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
561
+ case RepositoryStatus.CodeUsed: return "CodeUsed";
562
+ case RepositoryStatus.LockNotHeld: return "LockNotHeld";
563
+ case RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
564
+ case RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
565
+ case HttpStatus.Info: return "HTTP Info";
566
+ case HttpStatus.Redirection: return "HTTP Redirection";
567
+ case HttpStatus.ClientError: return "HTTP Client error";
568
+ case HttpStatus.ServerError: return "HTTP Server error";
569
+ case IModelHubStatus.Unknown: return "Unknown error";
570
+ case IModelHubStatus.MissingRequiredProperties: return "Missing required properties";
571
+ case IModelHubStatus.InvalidPropertiesValues: return "Invalid properties values";
572
+ case IModelHubStatus.UserDoesNotHavePermission: return "User does not have permission";
573
+ case IModelHubStatus.UserDoesNotHaveAccess: return "User does not have access";
574
+ case IModelHubStatus.InvalidBriefcase: return "Invalid briefcase";
575
+ case IModelHubStatus.BriefcaseDoesNotExist: return "Briefcase does not exist";
576
+ case IModelHubStatus.BriefcaseDoesNotBelongToUser: return "Briefcase does not belong to user";
577
+ case IModelHubStatus.AnotherUserPushing: return "Another user pushing";
578
+ case IModelHubStatus.ChangeSetAlreadyExists: return "ChangeSet already exists";
579
+ case IModelHubStatus.ChangeSetDoesNotExist: return "ChangeSet does not exist";
580
+ case IModelHubStatus.FileIsNotUploaded: return "File is not uploaded";
581
+ case IModelHubStatus.iModelIsNotInitialized: return "iModel is not initialized";
582
+ case IModelHubStatus.ChangeSetPointsToBadSeed: return "ChangeSet points to a bad seed file";
583
+ case IModelHubStatus.OperationFailed: return "iModelHub operation has failed";
584
+ case IModelHubStatus.PullIsRequired: return "Pull is required";
585
+ case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return "Limit of briefcases per user was reached";
586
+ case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return "Limit of briefcases per user per minute was reached";
587
+ case IModelHubStatus.DatabaseTemporarilyLocked: return "Database is temporarily locked";
588
+ case IModelHubStatus.iModelIsLocked: return "iModel is locked";
589
+ case IModelHubStatus.CodesExist: return "Code already exists";
590
+ case IModelHubStatus.LocksExist: return "Lock already exists";
591
+ case IModelHubStatus.iModelAlreadyExists: return "iModel already exists";
592
+ case IModelHubStatus.iModelDoesNotExist: return "iModel does not exist";
593
+ case IModelHubStatus.LockDoesNotExist: return "Lock does not exist";
594
+ case IModelHubStatus.LockChunkDoesNotExist: return "Lock chunk does not exist";
595
+ case IModelHubStatus.LockOwnedByAnotherBriefcase: return "Lock is owned by another briefcase";
596
+ case IModelHubStatus.CodeStateInvalid: return "Code state is invalid";
597
+ case IModelHubStatus.CodeReservedByAnotherBriefcase: return "Code is reserved by another briefcase";
598
+ case IModelHubStatus.CodeDoesNotExist: return "Code does not exist";
599
+ case IModelHubStatus.FileDoesNotExist: return "File does not exist";
600
+ case IModelHubStatus.FileAlreadyExists: return "File already exists";
601
+ case IModelHubStatus.EventTypeDoesNotExist: return "Event type does not exist";
602
+ case IModelHubStatus.EventSubscriptionDoesNotExist: return "Event subscription does not exist";
603
+ case IModelHubStatus.EventSubscriptionAlreadyExists: return "Event subscription already exists";
604
+ case IModelHubStatus.ITwinIdIsNotSpecified: return "ITwin Id is not specified";
605
+ case IModelHubStatus.FailedToGetITwinPermissions: return "Failed to get iTwin permissions";
606
+ case IModelHubStatus.FailedToGetITwinMembers: return "Failed to get iTwin members";
607
+ case IModelHubStatus.FailedToGetAssetPermissions: return "Failed to get asset permissions";
608
+ case IModelHubStatus.FailedToGetAssetMembers: return "Failed to get asset members";
609
+ case IModelHubStatus.ChangeSetAlreadyHasVersion: return "ChangeSet already has version";
610
+ case IModelHubStatus.VersionAlreadyExists: return "Version already exists";
611
+ case IModelHubStatus.JobSchedulingFailed: return "Failed to schedule a background job";
612
+ case IModelHubStatus.ConflictsAggregate: return "Codes or locks are owned by another briefcase";
613
+ case IModelHubStatus.FailedToGetITwinById: return "Failed to query iTwin by its id";
614
+ case IModelHubStatus.DatabaseOperationFailed: return "Database operation has failed";
615
+ case IModelHubStatus.ITwinDoesNotExist: return "ITwin does not exist";
616
+ case IModelHubStatus.UndefinedArgumentError: return "Undefined argument";
617
+ case IModelHubStatus.InvalidArgumentError: return "Invalid argument";
618
+ case IModelHubStatus.MissingDownloadUrlError: return "Missing download url";
619
+ case IModelHubStatus.NotSupportedInBrowser: return "Not supported in browser";
620
+ case IModelHubStatus.FileHandlerNotSet: return "File handler is not set";
621
+ case IModelHubStatus.FileNotFound: return "File not found";
622
+ case GeoServiceStatus.NoGeoLocation: return "No GeoLocation";
623
+ case GeoServiceStatus.OutOfUsefulRange: return "Out of useful range";
624
+ case GeoServiceStatus.OutOfMathematicalDomain: return "Out of mathematical domain";
625
+ case GeoServiceStatus.NoDatumConverter: return "No datum converter";
626
+ case GeoServiceStatus.VerticalDatumConvertError: return "Vertical datum convert error";
627
+ case GeoServiceStatus.CSMapError: return "CSMap error";
628
+ case GeoServiceStatus.Pending: return "Pending";
629
+ case RealityDataStatus.InvalidData: return "Invalid or unknown data";
630
+ case IModelStatus.Success:
631
+ case DbResult.BE_SQLITE_OK:
632
+ case DbResult.BE_SQLITE_ROW:
633
+ case DbResult.BE_SQLITE_DONE:
634
+ case BentleyStatus.SUCCESS:
635
+ return "Success";
636
+ default:
637
+ return `Error (${this.errorNumber})`;
638
+ }
639
+ }
640
+ /** Use run-time type checking to safely get a useful string summary of an unknown error value, or `""` if none exists.
641
+ * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`
642
+ * @public
643
+ */
644
+ static getErrorMessage(error) {
645
+ if (typeof error === "string")
646
+ return error;
647
+ if (error instanceof Error)
648
+ return error.toString();
649
+ if (isObject(error)) {
650
+ if (typeof error.message === "string")
651
+ return error.message;
652
+ if (typeof error.msg === "string")
653
+ return error.msg;
654
+ if (error.toString() !== "[object Object]")
655
+ return error.toString();
656
+ }
657
+ return "";
658
+ }
659
+ /** Use run-time type checking to safely get the call stack of an unknown error value, if possible.
660
+ * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof Error`
661
+ * @public
662
+ */
663
+ static getErrorStack(error) {
664
+ if (isObject(error) && typeof error.stack === "string")
665
+ return error.stack;
666
+ return undefined;
667
+ }
668
+ /** Use run-time type checking to safely get the metadata with an unknown error value, if possible.
669
+ * @note It's recommended to use this function in `catch` clauses, where a caught value cannot be assumed to be `instanceof BentleyError`
670
+ * @see [[BentleyError.getMetaData]]
671
+ * @public
672
+ */
673
+ static getErrorMetadata(error) {
674
+ if (isObject(error) && typeof error.getMetaData === "function") {
675
+ const metadata = error.getMetaData();
676
+ if (typeof metadata === "object" && metadata !== null)
677
+ return metadata;
678
+ }
679
+ return undefined;
680
+ }
681
+ /** Returns a new `ErrorProps` object representing an unknown error value. Useful for logging or wrapping/re-throwing caught errors.
682
+ * @note Unlike `Error` objects (which lose messages and call stacks when serialized to JSON), objects
683
+ * returned by this are plain old JavaScript objects, and can be easily logged/serialized to JSON.
684
+ * @public
685
+ */
686
+ static getErrorProps(error) {
687
+ const serialized = {
688
+ message: BentleyError.getErrorMessage(error),
689
+ };
690
+ const stack = BentleyError.getErrorStack(error);
691
+ if (stack)
692
+ serialized.stack = stack;
693
+ const metadata = BentleyError.getErrorMetadata(error);
694
+ if (metadata)
695
+ serialized.metadata = metadata;
696
+ return serialized;
697
+ }
698
+ }
696
699
  //# sourceMappingURL=BentleyError.js.map