eprolo-cli 1.0.57 → 1.0.59

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/bin/eprolo-cli.js CHANGED
@@ -90,7 +90,9 @@ async function postJsonWithRetry(url, body, config) {
90
90
  if (config.accessToken) headers["accessToken"] = `${config.accessToken}`;
91
91
 
92
92
  let result = await postJson(url, body, headers);
93
-
93
+ const err = new Error(`HTTP ${result}`);
94
+ err.response = result.data;
95
+ throw err;
94
96
  if (result.code === 400) {
95
97
  // 刷新 token
96
98
  const refreshRes = await postJson(REFRESH_API, {},{
@@ -111,9 +113,7 @@ async function postJsonWithRetry(url, body, config) {
111
113
  err.response = refreshRes.data;
112
114
  throw err;
113
115
  }
114
- }
115
-
116
- if (result.code !== 0) {
116
+ }else if (result.code !== 0) {
117
117
  const err = new Error(`HTTP ${result.statusCode}`);
118
118
  err.response = result.data;
119
119
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eprolo-cli",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "CLI for Dianxiaobao ICBU AI publishing, authorization profile management, task submission, and task status checks.",
5
5
  "bin": {
6
6
  "eprolo": "bin/eprolo-cli.js"