@api-client/core 0.12.10 → 0.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/browser.d.ts +0 -1
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +0 -1
- package/build/src/browser.js.map +1 -1
- package/build/src/exceptions/exception.d.ts +29 -1
- package/build/src/exceptions/exception.d.ts.map +1 -1
- package/build/src/exceptions/exception.js +37 -1
- package/build/src/exceptions/exception.js.map +1 -1
- package/build/src/index.d.ts +0 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +0 -1
- package/build/src/index.js.map +1 -1
- package/build/src/models/store/Backend.d.ts +15 -2
- package/build/src/models/store/Backend.d.ts.map +1 -1
- package/build/src/models/store/Backend.js.map +1 -1
- package/build/src/proxy/HttpProjectProxy.d.ts.map +1 -1
- package/build/src/proxy/HttpProjectProxy.js +39 -43
- package/build/src/proxy/HttpProjectProxy.js.map +1 -1
- package/build/src/proxy/RequestProxy.d.ts.map +1 -1
- package/build/src/proxy/RequestProxy.js +11 -11
- package/build/src/proxy/RequestProxy.js.map +1 -1
- package/build/src/runtime/store/DataCatalogSdk.d.ts.map +1 -1
- package/build/src/runtime/store/DataCatalogSdk.js +49 -109
- package/build/src/runtime/store/DataCatalogSdk.js.map +1 -1
- package/build/src/runtime/store/FilesSdk.d.ts.map +1 -1
- package/build/src/runtime/store/FilesSdk.js +51 -115
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/build/src/runtime/store/HistorySdk.d.ts.map +1 -1
- package/build/src/runtime/store/HistorySdk.js +25 -70
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- package/build/src/runtime/store/OrganizationsSdk.d.ts.map +1 -1
- package/build/src/runtime/store/OrganizationsSdk.js +46 -50
- package/build/src/runtime/store/OrganizationsSdk.js.map +1 -1
- package/build/src/runtime/store/RevisionsSdk.d.ts.map +1 -1
- package/build/src/runtime/store/RevisionsSdk.js +5 -10
- package/build/src/runtime/store/RevisionsSdk.js.map +1 -1
- package/build/src/runtime/store/SdkBase.d.ts +7 -5
- package/build/src/runtime/store/SdkBase.d.ts.map +1 -1
- package/build/src/runtime/store/SdkBase.js +45 -63
- package/build/src/runtime/store/SdkBase.js.map +1 -1
- package/build/src/runtime/store/SharedSdk.d.ts.map +1 -1
- package/build/src/runtime/store/SharedSdk.js +5 -14
- package/build/src/runtime/store/SharedSdk.js.map +1 -1
- package/build/src/runtime/store/TrashSdk.d.ts.map +1 -1
- package/build/src/runtime/store/TrashSdk.js +8 -28
- package/build/src/runtime/store/TrashSdk.js.map +1 -1
- package/build/src/runtime/store/UsersSdk.d.ts.map +1 -1
- package/build/src/runtime/store/UsersSdk.js +12 -11
- package/build/src/runtime/store/UsersSdk.js.map +1 -1
- package/package.json +1 -1
- package/src/exceptions/exception.ts +51 -4
- package/src/models/store/Backend.ts +16 -2
- package/src/proxy/HttpProjectProxy.ts +39 -43
- package/src/proxy/RequestProxy.ts +11 -11
- package/src/runtime/store/DataCatalogSdk.ts +49 -109
- package/src/runtime/store/FilesSdk.ts +51 -115
- package/src/runtime/store/HistorySdk.ts +25 -70
- package/src/runtime/store/OrganizationsSdk.ts +46 -50
- package/src/runtime/store/RevisionsSdk.ts +5 -10
- package/src/runtime/store/SdkBase.ts +46 -65
- package/src/runtime/store/SharedSdk.ts +5 -14
- package/src/runtime/store/TrashSdk.ts +8 -28
- package/src/runtime/store/UsersSdk.ts +12 -11
- package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +42 -40
- package/tests/unit/runtime/proxy/RequestProxy.spec.ts +11 -11
- package/build/src/runtime/store/Errors.d.ts +0 -51
- package/build/src/runtime/store/Errors.d.ts.map +0 -1
- package/build/src/runtime/store/Errors.js +0 -61
- package/build/src/runtime/store/Errors.js.map +0 -1
- package/src/runtime/store/Errors.ts +0 -98
|
@@ -14,11 +14,11 @@ import type {
|
|
|
14
14
|
DataCatalogStatus,
|
|
15
15
|
} from '../../models/DataCatalog.js'
|
|
16
16
|
import { RouteBuilder } from './RouteBuilder.js'
|
|
17
|
-
import { SdkError } from './Errors.js'
|
|
18
17
|
import { DataCatalogKind, DataCatalogVersionKind } from '../../models/kinds.js'
|
|
19
18
|
import type { DataCatalogVersionSchema } from '../../models/DataCatalogVersion.js'
|
|
20
19
|
import type { ForeignDomainDependency } from '../../modeling/types.js'
|
|
21
20
|
import type { DataDomainSchema } from '../../modeling/DataDomain.js'
|
|
21
|
+
import { Exception } from '../../exceptions/exception.js'
|
|
22
22
|
|
|
23
23
|
export interface DataCatalogListOptions extends ContextListOptions {
|
|
24
24
|
scope?: DataCatalogScope
|
|
@@ -41,25 +41,20 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
41
41
|
const E_PREFIX = 'Unable to list data domains. '
|
|
42
42
|
if (result.status !== 200) {
|
|
43
43
|
this.logInvalidResponse(result)
|
|
44
|
-
|
|
45
|
-
if (!e) {
|
|
46
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
47
|
-
e.response = result.body
|
|
48
|
-
}
|
|
49
|
-
throw e
|
|
44
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
50
45
|
}
|
|
51
46
|
if (!result.body) {
|
|
52
|
-
throw new
|
|
47
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
let data: ContextListResult<DataCatalogSchemaWithVersion>
|
|
56
51
|
try {
|
|
57
52
|
data = JSON.parse(result.body)
|
|
58
53
|
} catch {
|
|
59
|
-
throw new
|
|
54
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
60
55
|
}
|
|
61
56
|
if (!Array.isArray(data.items)) {
|
|
62
|
-
throw new
|
|
57
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
63
58
|
}
|
|
64
59
|
return data
|
|
65
60
|
}
|
|
@@ -75,24 +70,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
75
70
|
const E_PREFIX = 'Unable to list data domain versions. '
|
|
76
71
|
if (result.status !== 200) {
|
|
77
72
|
this.logInvalidResponse(result)
|
|
78
|
-
|
|
79
|
-
if (!e) {
|
|
80
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
81
|
-
e.response = result.body
|
|
82
|
-
}
|
|
83
|
-
throw e
|
|
73
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
84
74
|
}
|
|
85
75
|
if (!result.body) {
|
|
86
|
-
throw new
|
|
76
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
87
77
|
}
|
|
88
78
|
let data: ContextListResult<{ key: string; version: string; published: number }>
|
|
89
79
|
try {
|
|
90
80
|
data = JSON.parse(result.body)
|
|
91
81
|
} catch {
|
|
92
|
-
throw new
|
|
82
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
93
83
|
}
|
|
94
84
|
if (!Array.isArray(data.items)) {
|
|
95
|
-
throw new
|
|
85
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
96
86
|
}
|
|
97
87
|
return data
|
|
98
88
|
}
|
|
@@ -118,25 +108,20 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
118
108
|
const E_PREFIX = 'Unable to publish data domain. '
|
|
119
109
|
if (result.status !== 200) {
|
|
120
110
|
this.logInvalidResponse(result)
|
|
121
|
-
|
|
122
|
-
if (!e) {
|
|
123
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
124
|
-
e.response = result.body
|
|
125
|
-
}
|
|
126
|
-
throw e
|
|
111
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
127
112
|
}
|
|
128
113
|
|
|
129
114
|
if (!result.body) {
|
|
130
|
-
throw new
|
|
115
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
131
116
|
}
|
|
132
117
|
let data: ContextChangeRecord<DataCatalogSchema>
|
|
133
118
|
try {
|
|
134
119
|
data = JSON.parse(result.body)
|
|
135
120
|
} catch {
|
|
136
|
-
throw new
|
|
121
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
137
122
|
}
|
|
138
123
|
if (!data.key) {
|
|
139
|
-
throw new
|
|
124
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
140
125
|
}
|
|
141
126
|
return data
|
|
142
127
|
}
|
|
@@ -149,24 +134,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
149
134
|
const E_PREFIX = 'Unable to read data domain. '
|
|
150
135
|
if (result.status !== 200) {
|
|
151
136
|
this.logInvalidResponse(result)
|
|
152
|
-
|
|
153
|
-
if (!e) {
|
|
154
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
155
|
-
e.response = result.body
|
|
156
|
-
}
|
|
157
|
-
throw e
|
|
137
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
158
138
|
}
|
|
159
139
|
if (!result.body) {
|
|
160
|
-
throw new
|
|
140
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
161
141
|
}
|
|
162
142
|
let data: DataCatalogSchema
|
|
163
143
|
try {
|
|
164
144
|
data = JSON.parse(result.body)
|
|
165
145
|
} catch {
|
|
166
|
-
throw new
|
|
146
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
167
147
|
}
|
|
168
148
|
if (data.kind !== DataCatalogKind) {
|
|
169
|
-
throw new
|
|
149
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
170
150
|
}
|
|
171
151
|
return data
|
|
172
152
|
}
|
|
@@ -196,24 +176,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
196
176
|
const E_PREFIX = 'Unable to deprecate data domain. '
|
|
197
177
|
if (result.status !== 200) {
|
|
198
178
|
this.logInvalidResponse(result)
|
|
199
|
-
|
|
200
|
-
if (!e) {
|
|
201
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
202
|
-
e.response = result.body
|
|
203
|
-
}
|
|
204
|
-
throw e
|
|
179
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
205
180
|
}
|
|
206
181
|
if (!result.body) {
|
|
207
|
-
throw new
|
|
182
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
208
183
|
}
|
|
209
184
|
let data: ContextChangeRecord<DataCatalogSchema>
|
|
210
185
|
try {
|
|
211
186
|
data = JSON.parse(result.body)
|
|
212
187
|
} catch {
|
|
213
|
-
throw new
|
|
188
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
214
189
|
}
|
|
215
190
|
if (data.kind !== DataCatalogKind) {
|
|
216
|
-
throw new
|
|
191
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
217
192
|
}
|
|
218
193
|
return data
|
|
219
194
|
}
|
|
@@ -232,24 +207,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
232
207
|
const E_PREFIX = 'Unable to unpublish data domain. '
|
|
233
208
|
if (result.status !== 200) {
|
|
234
209
|
this.logInvalidResponse(result)
|
|
235
|
-
|
|
236
|
-
if (!e) {
|
|
237
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
238
|
-
e.response = result.body
|
|
239
|
-
}
|
|
240
|
-
throw e
|
|
210
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
241
211
|
}
|
|
242
212
|
if (!result.body) {
|
|
243
|
-
throw new
|
|
213
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
244
214
|
}
|
|
245
215
|
let data: ContextChangeRecord<DataCatalogSchema>
|
|
246
216
|
try {
|
|
247
217
|
data = JSON.parse(result.body)
|
|
248
218
|
} catch {
|
|
249
|
-
throw new
|
|
219
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
250
220
|
}
|
|
251
221
|
if (data.kind !== DataCatalogKind) {
|
|
252
|
-
throw new
|
|
222
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
253
223
|
}
|
|
254
224
|
return data
|
|
255
225
|
}
|
|
@@ -273,24 +243,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
273
243
|
const E_PREFIX = 'Unable to publish data domain version. '
|
|
274
244
|
if (result.status !== 200) {
|
|
275
245
|
this.logInvalidResponse(result)
|
|
276
|
-
|
|
277
|
-
if (!e) {
|
|
278
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
279
|
-
e.response = result.body
|
|
280
|
-
}
|
|
281
|
-
throw e
|
|
246
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
282
247
|
}
|
|
283
248
|
if (!result.body) {
|
|
284
|
-
throw new
|
|
249
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
285
250
|
}
|
|
286
251
|
let data: ContextChangeRecord<DataCatalogVersionSchema>
|
|
287
252
|
try {
|
|
288
253
|
data = JSON.parse(result.body)
|
|
289
254
|
} catch {
|
|
290
|
-
throw new
|
|
255
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
291
256
|
}
|
|
292
257
|
if (data.kind !== DataCatalogVersionKind) {
|
|
293
|
-
throw new
|
|
258
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
294
259
|
}
|
|
295
260
|
return data
|
|
296
261
|
}
|
|
@@ -303,24 +268,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
303
268
|
const E_PREFIX = 'Unable to read data domain version. '
|
|
304
269
|
if (result.status !== 200) {
|
|
305
270
|
this.logInvalidResponse(result)
|
|
306
|
-
|
|
307
|
-
if (!e) {
|
|
308
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
309
|
-
e.response = result.body
|
|
310
|
-
}
|
|
311
|
-
throw e
|
|
271
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
312
272
|
}
|
|
313
273
|
if (!result.body) {
|
|
314
|
-
throw new
|
|
274
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
315
275
|
}
|
|
316
276
|
let data: DataCatalogVersionSchema
|
|
317
277
|
try {
|
|
318
278
|
data = JSON.parse(result.body)
|
|
319
279
|
} catch {
|
|
320
|
-
throw new
|
|
280
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
321
281
|
}
|
|
322
282
|
if (data.kind !== DataCatalogVersionKind) {
|
|
323
|
-
throw new
|
|
283
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
324
284
|
}
|
|
325
285
|
return data
|
|
326
286
|
}
|
|
@@ -343,24 +303,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
343
303
|
const E_PREFIX = 'Unable to list data domain dependencies. '
|
|
344
304
|
if (result.status !== 200) {
|
|
345
305
|
this.logInvalidResponse(result)
|
|
346
|
-
|
|
347
|
-
if (!e) {
|
|
348
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
349
|
-
e.response = result.body
|
|
350
|
-
}
|
|
351
|
-
throw e
|
|
306
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
352
307
|
}
|
|
353
308
|
if (!result.body) {
|
|
354
|
-
throw new
|
|
309
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
355
310
|
}
|
|
356
311
|
let data: ContextListResult<DataDomainSchema[]>
|
|
357
312
|
try {
|
|
358
313
|
data = JSON.parse(result.body)
|
|
359
314
|
} catch {
|
|
360
|
-
throw new
|
|
315
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
361
316
|
}
|
|
362
317
|
if (!Array.isArray(data.items)) {
|
|
363
|
-
throw new
|
|
318
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
364
319
|
}
|
|
365
320
|
return data
|
|
366
321
|
}
|
|
@@ -385,24 +340,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
385
340
|
const E_PREFIX = 'Unable to deprecate data domain version. '
|
|
386
341
|
if (result.status !== 200) {
|
|
387
342
|
this.logInvalidResponse(result)
|
|
388
|
-
|
|
389
|
-
if (!e) {
|
|
390
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
391
|
-
e.response = result.body
|
|
392
|
-
}
|
|
393
|
-
throw e
|
|
343
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
394
344
|
}
|
|
395
345
|
if (!result.body) {
|
|
396
|
-
throw new
|
|
346
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
397
347
|
}
|
|
398
348
|
let data: ContextChangeRecord<DataCatalogVersionSchema>
|
|
399
349
|
try {
|
|
400
350
|
data = JSON.parse(result.body)
|
|
401
351
|
} catch {
|
|
402
|
-
throw new
|
|
352
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
403
353
|
}
|
|
404
354
|
if (data.kind !== DataCatalogVersionKind) {
|
|
405
|
-
throw new
|
|
355
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
406
356
|
}
|
|
407
357
|
return data
|
|
408
358
|
}
|
|
@@ -419,24 +369,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
419
369
|
const E_PREFIX = 'Unable to unpublish data domain version. '
|
|
420
370
|
if (result.status !== 200) {
|
|
421
371
|
this.logInvalidResponse(result)
|
|
422
|
-
|
|
423
|
-
if (!e) {
|
|
424
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
425
|
-
e.response = result.body
|
|
426
|
-
}
|
|
427
|
-
throw e
|
|
372
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
428
373
|
}
|
|
429
374
|
if (!result.body) {
|
|
430
|
-
throw new
|
|
375
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
431
376
|
}
|
|
432
377
|
let data: ContextChangeRecord<DataCatalogVersionSchema>
|
|
433
378
|
try {
|
|
434
379
|
data = JSON.parse(result.body)
|
|
435
380
|
} catch {
|
|
436
|
-
throw new
|
|
381
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
437
382
|
}
|
|
438
383
|
if (data.kind !== DataCatalogVersionKind) {
|
|
439
|
-
throw new
|
|
384
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
440
385
|
}
|
|
441
386
|
return data
|
|
442
387
|
}
|
|
@@ -449,24 +394,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
449
394
|
const E_PREFIX = 'Unable to check data domain publication status. '
|
|
450
395
|
if (result.status !== 200) {
|
|
451
396
|
this.logInvalidResponse(result)
|
|
452
|
-
|
|
453
|
-
if (!e) {
|
|
454
|
-
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)
|
|
455
|
-
e.response = result.body
|
|
456
|
-
}
|
|
457
|
-
throw e
|
|
397
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
|
|
458
398
|
}
|
|
459
399
|
if (!result.body) {
|
|
460
|
-
throw new
|
|
400
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
|
|
461
401
|
}
|
|
462
402
|
let data: DataCatalogStatus
|
|
463
403
|
try {
|
|
464
404
|
data = JSON.parse(result.body)
|
|
465
405
|
} catch {
|
|
466
|
-
throw new
|
|
406
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })
|
|
467
407
|
}
|
|
468
408
|
if (data.kind !== DataCatalogKind) {
|
|
469
|
-
throw new
|
|
409
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })
|
|
470
410
|
}
|
|
471
411
|
return data
|
|
472
412
|
}
|