You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/cli/src/lib/addons/destroy_addon.ts
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
import{color}from'@heroku/heroku-cli-util'
1
+
import{color,utils}from'@heroku/heroku-cli-util'
2
2
import{APIClient}from'@heroku-cli/command'
3
3
import*asHerokufrom'@heroku-cli/schema'
4
4
import{ux}from'@oclif/core'
@@ -15,10 +15,11 @@ export default async function (heroku: APIClient, addon: Heroku.AddOn, force = f
15
15
body: {force},
16
16
headers: {'Accept-Expansion': 'plan'},
17
17
}).catch(error=>{
18
-
if(error.body&&error.body.message){
19
-
thrownewError(`The add-on was unable to be destroyed: ${error.body.message}.`)
18
+
consterrorMessage=error.body?.message||error
19
+
if(utils.pg.isAdvancedDatabase(addon)){
20
+
thrownewError(`We can't destroy your database due to an error: ${errorMessage}. Try again or open a ticket with Heroku Support: https://help.heroku.com/`)
20
21
}else{
21
-
thrownewError(`The add-on was unable to be destroyed: ${error}.`)
22
+
thrownewError(`The add-on was unable to be destroyed: ${errorMessage}.`)
22
23
}
23
24
})
24
25
@@ -41,10 +42,14 @@ export default async function (heroku: APIClient, addon: Heroku.AddOn, force = f
0 commit comments