diff --git a/lib/rest/rest-entity.js b/lib/rest/rest-entity.js index 7d976c8..6a05a78 100644 --- a/lib/rest/rest-entity.js +++ b/lib/rest/rest-entity.js @@ -20,7 +20,9 @@ class RestEntity { console.log({sid, opts}); const res = await this.put(`Accounts/${this.accountSid}/${this.name}/${sid}`, opts); if (res.statusCode === 404) throw new Error(`${this.name}.update: sid ${sid} not found`); - if (res.statusCode !== 204) throw new Error(`${this.name}.update: unexpected status code ${res.statusCode}`); + if (![202, 204].includes(res.statusCode)) { + throw new Error(`${this.name}.update: unexpected status code ${res.statusCode}`); + } } async list(opts) { diff --git a/package.json b/package.json index 53ed169..6f6b082 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jambonz/node-client", - "version": "0.2.2", + "version": "0.2.3", "description": "", "main": "lib/index.js", "scripts": {