diff --git a/.gitignore b/.gitignore index 8aa7a2c..7118966 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ Temporary Items .apdisk node_modules +*.tgz #### JetBrains .idea diff --git a/Changelog.md b/Changelog.md index 4119ac8..aa91703 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,44 @@ # Changelog +## 1.3.6 - 2019-06-03 +- Fixed a bug where we were throwing an Error if the final GET on the resource while polling a long running DELETE operation would return a 404. [#azure-sdk-for-js/issues/2842](https://github.com/Azure/azure-sdk-for-js/issues/2842) +- Fixed vulnerabilities by updating package version of `nyc`. + +## 1.3.5 - 2019-05-17 +- Added missing exports to the package. + +## 1.3.4 - 2019-05-13 +- Updated version of the package to fix auto publishing script in CI. + +## 1.3.3 - 2019-04-05 +- Updated dependency `@azure/ms-rest-js`. + +## 1.3.2 - 2019-01-28 +- Fixed User-Agent tests + +## 1.3.1 - 2019-01-07 +- Fixed LRO RestErrors parsing +- Added JSON parsing error handling + +## 1.3.0 - 2019-01-07 +- Removed final GET on POST 202 long running operations + +## 1.2.4 - 2018-12-20 +- Updated checks in CI + +## 1.2.3 - 2018-12-20 +- Added checks to run before publishing + +## 1.2.2 - 2018-12-19 +- More test updates. + +## 1.2.1 - 2018-12-17 +- Enable test coverage in CI. + +## 1.2.0 - 2018-12-04 +- Update dependency `@azure/ms-rest-js`. + +## 1.1.2 - 2018-11-28 +- Fixed event-stream vulnerability ## 1.1.1 - 2018-11-13 diff --git a/lib/lroPollStrategy.ts b/lib/lroPollStrategy.ts index 78a50d1..80e0818 100644 --- a/lib/lroPollStrategy.ts +++ b/lib/lroPollStrategy.ts @@ -119,14 +119,16 @@ export abstract class LROPollStrategy { this._pollState.state = getProvisioningState(result.parsedBody) || "Succeeded"; this._pollState.mostRecentResponse = result; this._pollState.mostRecentRequest = result.request; - try { - this._pollState.resource = getResponseBody(result); - } catch (error) { - this._pollState.resource = undefined; - const resultStatus: number = result.status; - if (this._pollState.initialResponse.request.method !== "DELETE" || resultStatus < 400 || 499 < resultStatus) { + this._pollState.resource = getResponseBody(result); + }).catch((error) => { + let resultStatus: number | undefined; + if (error.response && error.response.status) { + resultStatus = error.response.status; + if (this._pollState.initialResponse.request.method !== "DELETE" || resultStatus! < 400 || 499 < resultStatus!) { throw error; } + } else { + throw error; } }); } diff --git a/package.json b/package.json index f8a75af..18f1813 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/ms-rest-azure-js" }, - "version": "1.3.5", + "version": "1.3.6", "description": "Isomorphic Azure client runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest", "tags": [ "isomorphic", @@ -41,7 +41,7 @@ ], "license": "MIT", "dependencies": { - "@azure/ms-rest-js": "^1.8.1", + "@azure/ms-rest-js": "^1.8.7", "tslib": "^1.9.2" }, "devDependencies": { @@ -54,7 +54,7 @@ "mocha-junit-reporter": "^1.18.0", "mocha-multi-reporters": "^1.1.7", "npm-run-all": "^4.1.5", - "nyc": "^13.1.0", + "nyc": "^14.1.1", "opn-cli": "^4.0.0", "rollup": "^0.67.3", "rollup-plugin-node-resolve": "^3.4.0",