@kibibot/cli 1.0.16 → 1.0.17
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/token.js +1 -0
- package/dist/lib/api.js +10 -2
- package/package.json +1 -1
package/dist/commands/token.js
CHANGED
package/dist/lib/api.js
CHANGED
|
@@ -40,11 +40,19 @@ function friendlyError(err) {
|
|
|
40
40
|
return detail;
|
|
41
41
|
return 'Rate limited. Try again later.';
|
|
42
42
|
}
|
|
43
|
-
default:
|
|
43
|
+
default: {
|
|
44
44
|
if (err.statusCode >= 500) {
|
|
45
45
|
return 'Server error. Try again later.';
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
const detail = err.body?.detail;
|
|
48
|
+
if (typeof detail === 'string')
|
|
49
|
+
return detail;
|
|
50
|
+
if (typeof detail === 'object' && detail !== null) {
|
|
51
|
+
const d = detail;
|
|
52
|
+
return d.message || d.error || JSON.stringify(detail);
|
|
53
|
+
}
|
|
54
|
+
return err.message || `HTTP ${err.statusCode}`;
|
|
55
|
+
}
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
58
|
/**
|