Skip to content

Commit 767f738

Browse files
authored
Update axios, log more information if notification POST fails (#64)
* Update axios, log more information if notification POST fails Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
1 parent 5ef72f5 commit 767f738

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

vcxagency-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@aws-sdk/client-s3": "^3.4.1",
38-
"axios": "^0.19.2",
38+
"axios": "^0.21.1",
3939
"body-parser": "^1.18.3",
4040
"dotenv": "^7.0.0",
4141
"easy-indysdk": "file:../easy-indysdk",

vcxagency-node/src/service/entities/agent-connection/agent-connection.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ async function buildAgentConnectionAO (entityRecord, serviceWallets, serviceStor
159159
.then(() => {
160160
logger.info(`Notification ${notificationId} from agentConnectionDid ${agentConnectionDid} sent to ${webhookUrl} successfully.`)
161161
}, reason => {
162-
logger.warn(`Notification ${notificationId} from agentConnectionDid ${agentConnectionDid} sent to ${webhookUrl} encountered problem. Reason: ${JSON.stringify(reason)}`)
162+
const respData = reason.response && reason.response.data
163+
? ` Response data ${JSON.stringify(reason.response.data)}`
164+
: ''
165+
logger.warn(`Notification ${notificationId} from agentConnectionDid ${agentConnectionDid} sent to ${webhookUrl} encountered problem. Reason: ${reason}. ${respData}`)
163166
})
164167
}
165168
}

vcxagency-node/yarn.lock

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,12 +1574,12 @@ axios@^0.18.1:
15741574
follow-redirects "1.5.10"
15751575
is-buffer "^2.0.2"
15761576

1577-
axios@^0.19.2:
1578-
version "0.19.2"
1579-
resolved "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
1580-
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
1577+
axios@^0.21.1:
1578+
version "0.21.1"
1579+
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
1580+
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
15811581
dependencies:
1582-
follow-redirects "1.5.10"
1582+
follow-redirects "^1.10.0"
15831583

15841584
babel-jest@^26.6.3:
15851585
version "26.6.3"
@@ -3072,6 +3072,11 @@ follow-redirects@1.5.10:
30723072
dependencies:
30733073
debug "=3.1.0"
30743074

3075+
follow-redirects@^1.10.0:
3076+
version "1.13.2"
3077+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147"
3078+
integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==
3079+
30753080
for-in@^1.0.2:
30763081
version "1.0.2"
30773082
resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@@ -6948,7 +6953,7 @@ vary@~1.1.2:
69486953
version "1.0.0"
69496954
dependencies:
69506955
axios "^0.18.1"
6951-
easy-indysdk "file:../../../Library/Caches/Yarn/v6/npm-vcxagency-client-1.0.0-a9e98ba4-cd0d-4411-8626-fd18f932a166-1612774131045/node_modules/easy-indysdk"
6956+
easy-indysdk "file:../../../../Library/Caches/Yarn/v6/npm-vcxagency-client-1.0.0-c5a2515b-273d-446e-92e4-5759fc5b58b3-1612878719303/node_modules/easy-indysdk"
69526957
query-string "^6.8.2"
69536958

69546959
verror@1.10.0:

0 commit comments

Comments
 (0)