@swell/cli 2.0.1-alpha.8 → 2.0.1-alpha.9
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/dist/commands/app/info.js +1 -1
- package/dist/lib/api.js +11 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ it will output all versions of the app instead.`;
|
|
|
47
47
|
const spinner = ora();
|
|
48
48
|
spinner.start('Retrieving app info...');
|
|
49
49
|
this.app = await this.getAppWithConfig().catch((error) => {
|
|
50
|
-
spinner.fail(`Error fetching app info
|
|
50
|
+
spinner.fail(`Error fetching app info:`);
|
|
51
51
|
throw error;
|
|
52
52
|
});
|
|
53
53
|
if (spinner.isSpinning) {
|
package/dist/lib/api.js
CHANGED
|
@@ -65,8 +65,17 @@ export default class Api {
|
|
|
65
65
|
throw new Error('Operation not supported.');
|
|
66
66
|
const resp = await fetch(path, fetchOptions);
|
|
67
67
|
const respData = await resp.text();
|
|
68
|
-
if (!resp.ok)
|
|
69
|
-
|
|
68
|
+
if (!resp.ok) {
|
|
69
|
+
// Try to parse error message
|
|
70
|
+
let errorJson;
|
|
71
|
+
try {
|
|
72
|
+
errorJson = JSON.parse(respData);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// ignore
|
|
76
|
+
}
|
|
77
|
+
throw new Error(errorJson?.error?.message || errorJson?.error || respData);
|
|
78
|
+
}
|
|
70
79
|
try {
|
|
71
80
|
return JSON.parse(respData);
|
|
72
81
|
}
|
package/oclif.manifest.json
CHANGED