@axway/axway-central-cli 2.14.0 → 2.14.2
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.
|
@@ -60,7 +60,7 @@ const action = async ({
|
|
|
60
60
|
const parsedValue = String(argv.region).toUpperCase();
|
|
61
61
|
|
|
62
62
|
if (!(parsedValue in _types.Regions)) {
|
|
63
|
-
throw Error(
|
|
63
|
+
throw Error(`"--region" value is not correct, please provide one of: ${Object.values(_types.Regions).sort().join(', ')}. For example: "axway central config set --region=US"`);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
log(`Writing ${_types.ConfigTypes.REGION}`);
|
|
@@ -71,7 +71,7 @@ const action = async ({
|
|
|
71
71
|
const parsedValue = String(argv.platform).toLowerCase();
|
|
72
72
|
|
|
73
73
|
if (!(parsedValue in _types.Platforms)) {
|
|
74
|
-
throw Error(
|
|
74
|
+
throw Error(`"--platform" value is not correct, please provide one of: ${Object.values(_types.Platforms).sort().join(', ')}. For example: "axway central config set --platform=staging"`);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
log(`Writing ${_types.ConfigTypes.PLATFORM}`);
|
|
@@ -82,7 +82,7 @@ const action = async ({
|
|
|
82
82
|
log(`Writing ${_types.ConfigTypes.APIC_DEPLOYMENT}`);
|
|
83
83
|
|
|
84
84
|
if (!Object.values(_types.APICDeployments).includes(argv.apicDeployment)) {
|
|
85
|
-
throw Error(
|
|
85
|
+
throw Error(`"--apic-deployment" value is not correct, please provide one of: ${Object.values(_types.APICDeployments).sort().join(', ')}. For example: "axway central config set --apic-deployment=staging"`);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
config[_types.ConfigTypes.APIC_DEPLOYMENT] = argv.apicDeployment;
|
package/dist/common/utils.js
CHANGED
|
@@ -99,7 +99,7 @@ const loadAndVerifySpecs = async (specFilePath, allowedKinds) => {
|
|
|
99
99
|
try {
|
|
100
100
|
docs = (0, _jsYaml.loadAll)(await (0, _fsExtra.readFile)(specFilePath, 'utf8'));
|
|
101
101
|
} catch (e) {
|
|
102
|
-
throw new Error(`File content is invalid.`);
|
|
102
|
+
throw new Error(e.reason && e.reason.includes('null byte') ? `File encoding is invalid, please make sure it is using UTF-8` : `File content is invalid.`);
|
|
103
103
|
} // if user pass an array of json objects, docs const will have nested array, workaround for this:
|
|
104
104
|
|
|
105
105
|
|