locize-cli 8.1.0 → 8.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  Project versioning adheres to [Semantic Versioning](http://semver.org/).
6
6
  Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
7
7
 
8
+ ## [8.1.1](https://github.com/locize/locize-cli/compare/v8.1.0...v8.1.1) - 2024-10-29
9
+
10
+ - improve some error logs
11
+
8
12
  ## [8.1.0](https://github.com/locize/locize-cli/compare/v8.0.2...v8.1.0) - 2024-09-19
9
13
 
10
14
  - introduce `--languages lng1,lng2` argument (#96)
@@ -6,7 +6,12 @@ const getRemoteLanguages = (opt, cb) => {
6
6
  }, (err, res, obj) => {
7
7
  if (err || (obj && (obj.errorMessage || obj.message))) {
8
8
  if (err) return cb(err);
9
- if (obj && (obj.errorMessage || obj.message)) return cb(new Error((obj.errorMessage || obj.message)));
9
+ if (obj && (obj.errorMessage || obj.message)) {
10
+ if (res && res.statusText && res.status) {
11
+ return cb(new Error(res.statusText + ' (' + res.status + ') | ' + (obj.errorMessage || obj.message)));
12
+ }
13
+ return cb(new Error((obj.errorMessage || obj.message)));
14
+ }
10
15
  }
11
16
  if (res.status >= 300) return cb(new Error(res.statusText + ' (' + res.status + ')'));
12
17
 
@@ -22,6 +22,9 @@ const pullNamespacePaged = (opt, lng, ns, cb, next, retry) => {
22
22
  return;
23
23
  }
24
24
  if (obj && (obj.errorMessage || obj.message)) {
25
+ if (res.statusText && res.status) {
26
+ return cb(new Error(res.statusText + ' (' + res.status + ') | ' + (obj.errorMessage || obj.message)));
27
+ }
25
28
  return cb(new Error((obj.errorMessage || obj.message)));
26
29
  }
27
30
  return cb(new Error(res.statusText + ' (' + res.status + ')'));
@@ -70,6 +73,9 @@ const getRemoteNamespace = (opt, lng, ns, cb) => {
70
73
  if (err) return cb(err);
71
74
  if (res.status >= 300) {
72
75
  if (obj && (obj.errorMessage || obj.message)) {
76
+ if (res.statusText && res.status) {
77
+ return cb(new Error(res.statusText + ' (' + res.status + ') | ' + (obj.errorMessage || obj.message)));
78
+ }
73
79
  return cb(new Error((obj.errorMessage || obj.message)));
74
80
  }
75
81
  return cb(new Error(res.statusText + ' (' + res.status + ')'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "8.1.0",
3
+ "version": "8.1.1",
4
4
  "description": "locize cli to import locales",
5
5
  "main": "index.js",
6
6
  "bin": {
package/sync.js CHANGED
@@ -35,6 +35,9 @@ const getDownloads = (opt, cb) => {
35
35
  if (err) return cb(err);
36
36
  if (res.status >= 300) {
37
37
  if (obj && (obj.errorMessage || obj.message)) {
38
+ if (res.statusText && res.status) {
39
+ return cb(new Error(res.statusText + ' (' + res.status + ') | ' + (obj.errorMessage || obj.message)));
40
+ }
38
41
  return cb(new Error((obj.errorMessage || obj.message)));
39
42
  }
40
43
  return cb(new Error(res.statusText + ' (' + res.status + ')'));