| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1338,7 +1338,12 @@ E('ERR_IMPORT_ATTRIBUTE_MISSING', | |||
| 1338 | 1338 | E('ERR_IMPORT_ATTRIBUTE_TYPE_INCOMPATIBLE', | |
| 1339 | 1339 | 'Module "%s" is not of type "%s"', TypeError); | |
| 1340 | 1340 | E('ERR_IMPORT_ATTRIBUTE_UNSUPPORTED', | |
| 1341 | - 'Import attribute "%s" with value "%s" is not supported', TypeError); | ||
| 1341 | + function error(attribute, value, url = undefined) { | ||
| 1342 | + if (url === undefined) { | ||
| 1343 | + return `Import attribute "${attribute}" with value "${value}" is not supported`; | ||
| 1344 | + } | ||
| 1345 | + return `Import attribute "${attribute}" with value "${value}" is not supported in ${url}`; | ||
| 1346 | + }, TypeError); | ||
| 1342 | 1347 | E('ERR_INCOMPATIBLE_OPTION_PAIR', | |
| 1343 | 1348 | 'Option "%s" cannot be used in combination with option "%s"', TypeError, HideStackFramesError); | |
| 1344 | 1349 | E('ERR_INPUT_TYPE_NOT_ALLOWED', '--input-type can only be used with string ' + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ function validateAttributes(url, format, | |||
| 57 | 57 | const keys = ObjectKeys(importAttributes); | |
| 58 | 58 | for (let i = 0; i < keys.length; i++) { | |
| 59 | 59 | if (keys[i] !== 'type') { | |
| 60 | - throw new ERR_IMPORT_ATTRIBUTE_UNSUPPORTED(keys[i], importAttributes[keys[i]]); | ||
| 60 | + throw new ERR_IMPORT_ATTRIBUTE_UNSUPPORTED(keys[i], importAttributes[keys[i]], url); | ||
| 61 | 61 | } | |
| 62 | 62 | } | |
| 63 | 63 | const validType = formatTypeMap[format]; | |
@@ -102,7 +102,7 @@ function handleInvalidType(url, type) { | |||
| 102 | 102 | ||
| 103 | 103 | // `type` might not have been one of the types we understand. | |
| 104 | 104 | if (!ArrayPrototypeIncludes(supportedTypeAttributes, type)) { | |
| 105 | - throw new ERR_IMPORT_ATTRIBUTE_UNSUPPORTED('type', type); | ||
| 105 | + throw new ERR_IMPORT_ATTRIBUTE_UNSUPPORTED('type', type, url); | ||
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | 108 | // `type` was the wrong value for this format. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments