mirror of
https://github.com/jambonz/jambonz-node.git
synced 2026-01-25 02:08:15 +00:00
fix retrieve call cdr by sid return null
This commit is contained in:
@@ -34,7 +34,7 @@ class RestEntity {
|
|||||||
try {
|
try {
|
||||||
const res = await this.get(`Accounts/${this.accountSid}/${this.name}/${sid}`);
|
const res = await this.get(`Accounts/${this.accountSid}/${this.name}/${sid}`);
|
||||||
//get call by sid will return call cdr as a object and not an array
|
//get call by sid will return call cdr as a object and not an array
|
||||||
return res ? res : null;
|
return res;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.statusCode === 404) throw new Error(`${this.name}.retrieve: sid ${sid} not found`);
|
if (err.statusCode === 404) throw new Error(`${this.name}.retrieve: sid ${sid} not found`);
|
||||||
if (err.statusCode !== 204) throw new Error(`${this.name}.retrieve: unexpected status code ${err.statusCode}`);
|
if (err.statusCode !== 204) throw new Error(`${this.name}.retrieve: unexpected status code ${err.statusCode}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user