heroku-cli-addons
Advanced tools
Comparing version 1.2.7 to 1.2.8
@@ -28,2 +28,10 @@ 'use strict' | ||
const handleNotFound = function (err, resource) { | ||
if (err.statusCode === 404 && err.body && err.body.resource === resource) { | ||
return true | ||
} else { | ||
throw err | ||
} | ||
} | ||
exports.appAddon = appAddon | ||
@@ -45,3 +53,3 @@ | ||
return appAddon(heroku, app, id, options) | ||
.catch(function (err) { if (err.statusCode === 404) return getAddon(id); else throw err }) | ||
.catch(function (err) { if (handleNotFound(err, 'add_on')) return getAddon(id) }) | ||
} | ||
@@ -118,3 +126,3 @@ | ||
}).then(singularize('addon_attachment')) | ||
.catch(function (err) { if (err.statusCode !== 404) throw err }) | ||
.catch(function (err) { handleNotFound(err, 'add_on attachment') }) | ||
} | ||
@@ -133,3 +141,3 @@ | ||
promise = appAttachment(heroku, app, id, options) | ||
.catch(function (err) { if (err.statusCode !== 404) throw err }) | ||
.catch(function (err) { handleNotFound(err, 'add_on attachment') }) | ||
} | ||
@@ -136,0 +144,0 @@ |
{ | ||
"name": "heroku-cli-addons", | ||
"description": "`heroku addons:*` commands", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"author": "Bo Jeanes @bjeanes", | ||
@@ -6,0 +6,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125408
1181