Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excel-export: Promise rejection if token invalid or api not reachable SP 2 #1116

Closed
1 task done
Stezido opened this issue Apr 22, 2022 · 0 comments · Fixed by #1410
Closed
1 task done

excel-export: Promise rejection if token invalid or api not reachable SP 2 #1116

Stezido opened this issue Apr 22, 2022 · 0 comments · Fixed by #1410
Assignees
Labels
api Indicates api related issue or feature bug Something isn't working excel-export-service Indicates excel-export-service related issue or feature

Comments

@Stezido
Copy link
Contributor

Stezido commented Apr 22, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Description 😯

excel-export fails with following error if api cannot be reached:

[2022-04-22 14:57:39.178 +0000] ERROR (Excel-Export-Service on CPX-Z14FUDAJ0LV): Error validating token
    err: {
      "message": "connect ECONNREFUSED 127.0.0.1:8081",
      "stack":
          Error: connect ECONNREFUSED 127.0.0.1:8081
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
      "config": {
        "url": "http://127.0.0.1:8081/api/version",
        "method": "get",
        "headers": {
          "Accept": "application/json, text/plain, */*",
          "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJyb290IiwiYWRkcmVzcyI6IjFhZDM1OHRudVR2UWQ5V3BIUUxQWG1yWXQ5U2VwcGl3UFFOZ05MIiwib3JnYW5pemF0aW9uIjoiTXlPcmdhIiwib3JnYW5pemF0aW9uQWRkcmVzcyI6IjFhZDM1OHRudVR2UWQ5V3BIUUxQWG1yWXQ5U2VwcGl3UFFOZ05MIiwiZ3JvdXBzIjpbXSwiaWF0IjoxNjUwNjM5NDU1LCJleHAiOjE2NTA2NjgyNTV9.DyQzikfyKSO0hZ48g37QJPTzuHeZA7q0FzR0H3gnGqs",
          "User-Agent": "axios/0.21.4"
        },
        "transformRequest": [
          null
        ],
        "transformResponse": [
          null
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "transitional": {
          "silentJSONParsing": true,
          "forcedJSONParsing": true,
          "clarifyTimeoutError": false
        }
      },
      "code": "ECONNREFUSED"
    }
[2022-04-22 14:57:39.180 +0000] FATAL (Excel-Export-Service on CPX-Z14FUDAJ0LV): UNHANDLED PROMISE REJECTION
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of undefined (reading 'status')",
      "stack":
          TypeError: Cannot read properties of undefined (reading 'status')
              at /home/stefan/github/TruBudget/excel-export-service/dist/index.js:79:37
              at processTicksAndRejections (node:internal/process/task_queues:96:5)
    }

The first error is maybe correct, but it shouldn't be an unhandled promise rejection.

@Stezido Stezido added the bug Something isn't working label Apr 22, 2022
@Stezido Stezido added this to the TruBudget 2.0.0 milestone Apr 22, 2022
@issuelabeler issuelabeler bot added the api Indicates api related issue or feature label Apr 22, 2022
@Stezido Stezido added excel-export-service Indicates excel-export-service related issue or feature and removed api Indicates api related issue or feature labels Apr 22, 2022
@Stezido Stezido changed the title excel-export: Promise rejection if token invalid or api not reachable excel-export: Promise rejection if token invalid or api not reachable SP 2 May 5, 2022
@issuelabeler issuelabeler bot added the api Indicates api related issue or feature label May 5, 2022
@andrea-smiesna andrea-smiesna self-assigned this Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Indicates api related issue or feature bug Something isn't working excel-export-service Indicates excel-export-service related issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants