diff --git a/CHANGELOG.md b/CHANGELOG.md index bf298a9..ad3d188 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [v4.22.1](https://github.com/plivo/plivo-node/tree/v4.22.1) (2021-09-08) +- Fix on voice `GET` request and exception handle. + ## [v4.22.0](https://github.com/plivo/plivo-node/tree/v4.22.0) (2021-08-17) - Fix [add numbers to a powerpack](https://www.plivo.com/docs/sms/api/numberpool/#add-a-number) API by reverting retrievable object responses support for [Retrieve a Power pack API](https://www.plivo.com/docs/sms/api/powerpack#retrieve-a-powerpack). diff --git a/lib/rest/axios.js b/lib/rest/axios.js index ba74448..c927ed5 100644 --- a/lib/rest/axios.js +++ b/lib/rest/axios.js @@ -183,6 +183,10 @@ export function Axios(config) { if (isVoiceReq) { retryWrapper(axios, {retryTime: 2, urls: apiVoiceUris, authId: config.authId, action: action}); options.url = apiVoiceUris[0] + config.authId + '/' + action; + if (method === 'GET' && options.data !== '') { + let query = '?' + queryString.stringify(params); + options.url += query; + } axios(options).then(response => { const exceptionClass = { 400: Exceptions.InvalidRequestError, @@ -207,6 +211,9 @@ export function Axios(config) { }); }) .catch(function (error) { + if (error.response == undefined){ + reject(error.stack ); + } const exceptionClass = { 400: Exceptions.InvalidRequestError, 401: Exceptions.AuthenticationError, @@ -260,6 +267,9 @@ export function Axios(config) { } }) .catch(function (error) { + if (error.response == undefined){ + reject(error.stack ); + } const exceptionClass = { 400: Exceptions.InvalidRequestError, 401: Exceptions.AuthenticationError, diff --git a/package.json b/package.json index e76ea7e..c443cf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.22.0", + "version": "4.22.1", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [