jsii 5.5.0 → 5.5.1-dev.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/assembler.js CHANGED
@@ -23,6 +23,7 @@ const deprecated_remover_1 = require("./transforms/deprecated-remover");
23
23
  const deprecation_warnings_1 = require("./transforms/deprecation-warnings");
24
24
  const runtime_info_1 = require("./transforms/runtime-info");
25
25
  const utils_1 = require("./transforms/utils");
26
+ const utils_2 = require("./utils");
26
27
  const validator_1 = require("./validator");
27
28
  const version_1 = require("./version");
28
29
  const warnings_1 = require("./warnings");
@@ -63,7 +64,7 @@ class Assembler {
63
64
  let allowlistedDeprecations;
64
65
  if (options.stripDeprecatedAllowListFile) {
65
66
  if (!fs.existsSync(options.stripDeprecatedAllowListFile)) {
66
- throw new Error(`--strip-deprecated file not found: ${options.stripDeprecatedAllowListFile}`);
67
+ throw new utils_2.JsiiError(`--strip-deprecated file not found: ${options.stripDeprecatedAllowListFile}`);
67
68
  }
68
69
  allowlistedDeprecations = new Set(fs.readFileSync(options.stripDeprecatedAllowListFile, 'utf8').split('\n'));
69
70
  }
@@ -1048,7 +1049,7 @@ class Assembler {
1048
1049
  _getTypeFromTypeNode(t) {
1049
1050
  const type = this._typeChecker.getTypeFromTypeNode(t);
1050
1051
  if (isErrorType(type)) {
1051
- throw new Error(`Unable to resolve type: ${t.getFullText()}. This typically happens if something is wrong with your dependency closure.`);
1052
+ throw new utils_2.JsiiError(`Unable to resolve type: ${t.getFullText()}. This typically happens if something is wrong with your dependency closure.`);
1052
1053
  }
1053
1054
  return type;
1054
1055
  }
@@ -1146,7 +1147,7 @@ class Assembler {
1146
1147
  symbol = getSymbolFromDeclaration(decl, this._typeChecker);
1147
1148
  }
1148
1149
  if (!decl || !symbol || !ts.isEnumDeclaration(decl)) {
1149
- throw new Error(`Unable to resolve enum declaration for ${type.symbol.name}!`);
1150
+ throw new utils_2.JsiiError(`Unable to resolve enum declaration for ${type.symbol.name}!`);
1150
1151
  }
1151
1152
  if (_hasInternalJsDocTag(symbol)) {
1152
1153
  return undefined;