avo 3.2.1 → 3.2.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.
Files changed (2) hide show
  1. package/cli.js +14 -2
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -135,8 +135,20 @@ function responseToError(response) {
135
135
  }
136
136
  }
137
137
  if (!body.error) {
138
+ const getMessage = (statusCode) => {
139
+ switch (statusCode) {
140
+ case 401:
141
+ return 'Unauthorized';
142
+ case 403:
143
+ return 'Forbidden. Do you have the required permissions? Some commands editor or admin access.';
144
+ case 404:
145
+ return 'Not Found';
146
+ default:
147
+ return 'Unknown Error';
148
+ }
149
+ };
138
150
  body.error = {
139
- message: response.statusCode === 404 ? 'Not Found' : 'Unknown Error',
151
+ message: getMessage(response.statusCode),
140
152
  };
141
153
  }
142
154
  const message = `HTTP Error: ${response.statusCode}, ${body.error.message ?? body.error}`;
@@ -1404,7 +1416,7 @@ yargs(hideBin(process.argv)) // eslint-disable-line no-unused-expressions
1404
1416
  type: 'boolean',
1405
1417
  })
1406
1418
  .option('forceFeatures', {
1407
- describe: 'Optional comma separated list of features to force enable',
1419
+ describe: 'Optional comma separated list of features to force enable, pass unsupported name to get the list of available features',
1408
1420
  default: undefined,
1409
1421
  type: 'string',
1410
1422
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "type": "module",
5
5
  "description": "The command-line interface for Avo",
6
6
  "author": "Avo (https://www.avo.app)",