@jsii/kernel 1.69.0 → 1.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/api.d.ts CHANGED
@@ -161,6 +161,7 @@ export interface CallbacksResponse {
161
161
  export interface CompleteRequest {
162
162
  readonly cbid: string;
163
163
  readonly err?: string;
164
+ readonly name?: string;
164
165
  readonly result?: any;
165
166
  }
166
167
  export interface CompleteResponse {
package/lib/kernel.js CHANGED
@@ -302,7 +302,12 @@ class Kernel {
302
302
  }
303
303
  catch (e) {
304
304
  this._debug('promise error:', e);
305
- throw new JsiiFault(e.message);
305
+ if (e.name === "@jsii/kernel.Fault" /* JsiiErrorType.JSII_FAULT */) {
306
+ throw new JsiiFault(e.message);
307
+ }
308
+ // default to RuntimeError, since non-kernel errors may not
309
+ // have their `name` field defined
310
+ throw new RuntimeError(e);
306
311
  }
307
312
  return {
308
313
  result: this._fromSandbox(result, (_a = method.returns) !== null && _a !== void 0 ? _a : 'void', `returned by async method ${method.name}`),
@@ -328,7 +333,7 @@ class Kernel {
328
333
  }
329
334
  complete(req) {
330
335
  var _a;
331
- const { cbid, err, result } = req;
336
+ const { cbid, err, result, name } = req;
332
337
  this._debug('complete', cbid, err, result);
333
338
  const cb = this.waiting.get(cbid);
334
339
  if (!cb) {
@@ -336,7 +341,9 @@ class Kernel {
336
341
  }
337
342
  if (err) {
338
343
  this._debug('completed with error:', err);
339
- cb.fail(new Error(err));
344
+ cb.fail(name === "@jsii/kernel.Fault" /* JsiiErrorType.JSII_FAULT */
345
+ ? new JsiiFault(err)
346
+ : new RuntimeError(err));
340
347
  }
341
348
  else {
342
349
  const sandoxResult = this._toSandbox(result, (_a = cb.expectedReturnType) !== null && _a !== void 0 ? _a : 'void', `returned by callback ${cb.toString()}`);
package/lib/recording.js CHANGED
@@ -57,7 +57,7 @@ function recordInteraction(kernel, inputOutputLogPath) {
57
57
  }
58
58
  catch (e) {
59
59
  logOutput({ error: e.message, name: e.name });
60
- if (e.type === "@jsii/kernel.RuntimeError" /* JsiiErrorType.RUNTIME_ERROR */) {
60
+ if (e.name === "@jsii/kernel.RuntimeError" /* JsiiErrorType.RUNTIME_ERROR */) {
61
61
  throw new kernel_1.RuntimeError(e.message);
62
62
  }
63
63
  throw new kernel_1.JsiiFault(e.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsii/kernel",
3
- "version": "1.69.0",
3
+ "version": "1.71.0",
4
4
  "description": "kernel for jsii execution environment",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -31,19 +31,19 @@
31
31
  "package": "package-js"
32
32
  },
33
33
  "dependencies": {
34
- "@jsii/spec": "^1.69.0",
34
+ "@jsii/spec": "^1.71.0",
35
35
  "fs-extra": "^10.1.0",
36
36
  "lockfile": "^1.0.4",
37
- "tar": "^6.1.11"
37
+ "tar": "^6.1.12"
38
38
  },
39
39
  "devDependencies": {
40
- "@scope/jsii-calc-base": "^1.69.0",
41
- "@scope/jsii-calc-lib": "^1.69.0",
40
+ "@scope/jsii-calc-base": "^1.71.0",
41
+ "@scope/jsii-calc-lib": "^1.71.0",
42
42
  "@types/fs-extra": "^9.0.13",
43
43
  "@types/lockfile": "^1.0.2",
44
- "@types/tar": "^6.1.2",
45
- "jest-expect-message": "^1.1.2",
46
- "jsii-build-tools": "^1.69.0",
44
+ "@types/tar": "^6.1.3",
45
+ "jest-expect-message": "^1.1.3",
46
+ "jsii-build-tools": "^1.71.0",
47
47
  "jsii-calc": "^3.20.120"
48
48
  }
49
49
  }