Merge pull request #209 from plivo/issue-204_patch

Voice GET request and Exception handle
This commit is contained in:
Mohammed Huzaif 2021-09-08 13:16:20 +05:30 committed by GitHub
commit f4d3b4505c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -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).

View file

@ -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,

View file

@ -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": [