mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-04 22:07:01 -06:00
Merge pull request #209 from plivo/issue-204_patch
Voice GET request and Exception handle
This commit is contained in:
commit
f4d3b4505c
3 changed files with 14 additions and 1 deletions
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue