@kata.dev/challenge-cli 1.1.0 → 1.1.1

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/package.json +1 -1
  2. package/src/lib/http.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kata.dev/challenge-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "CLI for authoring, packing, validating, and publishing Eval Engine challenges",
6
6
  "bin": {
package/src/lib/http.js CHANGED
@@ -63,6 +63,11 @@ export async function requestJson(url, { method, body, token }) {
63
63
  const error = new Error(message);
64
64
  error.status = response.status;
65
65
  error.payload = payload;
66
+
67
+ if (response.status === 401) {
68
+ error.message += `\n\n${require('chalk').yellow('Hint:')} Your token has expired or is invalid.\nRun ${require('chalk').cyan('npx "@kata.dev/challenge-cli" login')} to refresh it.`;
69
+ }
70
+
66
71
  throw error;
67
72
  }
68
73