asciidoctor-jira 3.4.1 → 3.4.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/lib/Jira.js +16 -6
  2. package/package.json +4 -4
package/lib/Jira.js CHANGED
@@ -58,12 +58,22 @@ class Jira {
58
58
  headers: this.headers,
59
59
  qs: data
60
60
  })
61
- if (res.statusCode === 200) {
62
- if (res.headers['x-seraph-loginreason'] === 'AUTHENTICATED_FAILED') {
63
- this.doc.getLogger().error(`Authentication failed for jira instance ${this.jiraBaseUrl}.`)
64
- issues = []
65
- } else {
66
- issues = JSON.parse(res.getBody('utf-8')).issues
61
+ issues = []
62
+ switch (res.statusCode) {
63
+ case 200: {
64
+ if (res.headers['x-seraph-loginreason'] === 'AUTHENTICATED_FAILED') {
65
+ this.doc.getLogger().error(`Authentication failed for jira instance ${this.jiraBaseUrl}.`)
66
+ } else {
67
+ issues = JSON.parse(res.getBody('utf-8')).issues
68
+ }
69
+ break
70
+ }
71
+ case 400: {
72
+ const errorMessages = JSON.parse(res.body).errorMessages
73
+ for (const errorMessage of errorMessages) {
74
+ this.doc.getLogger().error(`${JSON.stringify(data)} - ${errorMessage}`)
75
+ }
76
+ break
67
77
  }
68
78
  }
69
79
  } catch (err) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "asciidoctor-jira",
3
3
  "author": "Constantin Krüger (https://github.com/uniqueck)",
4
4
  "license": "MIT",
5
- "version": "3.4.1",
5
+ "version": "3.4.2",
6
6
  "bugs": {
7
7
  "url": "https://github.com/doctoolchain/asciidoctor-jira/issues"
8
8
  },
@@ -25,7 +25,7 @@
25
25
  "rusha": "^0.8"
26
26
  },
27
27
  "devDependencies": {
28
- "@antora/site-generator-default": "^3.1.4",
28
+ "@antora/site-generator-default": "^3.1.5",
29
29
  "@asciidoctor/core": "^2.2.6",
30
30
  "@semantic-release/changelog": "^6.0.3",
31
31
  "@semantic-release/git": "^10.0.1",
@@ -34,9 +34,9 @@
34
34
  "conventional-changelog-eslint": "^5.0.0",
35
35
  "mocha": "^10.2.0",
36
36
  "rimraf": "^5.0.5",
37
- "semantic-release": "^22.0.5",
37
+ "semantic-release": "^22.0.8",
38
38
  "shx": "^0.3.4",
39
- "eslint": "^8.50.0",
39
+ "eslint": "^8.54.0",
40
40
  "eslint-config-standard": "^17.1.0",
41
41
  "eslint-config-ideal": "^1.0.0"
42
42
  },