wrangler 4.16.0 → 4.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.16.0",
3
+ "version": "4.16.1",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -19864,7 +19864,7 @@ var name, version;
19864
19864
  var init_package = __esm({
19865
19865
  "package.json"() {
19866
19866
  name = "wrangler";
19867
- version = "4.16.0";
19867
+ version = "4.16.1";
19868
19868
  }
19869
19869
  });
19870
19870
 
@@ -75997,7 +75997,7 @@ async function deleteCommand2(deleteArgs, _config) {
75997
75997
  "You must provide an ID. Use 'wrangler containers list` to view your containers."
75998
75998
  );
75999
75999
  }
76000
- if (deleteArgs.json || !isInteractive2()) {
76000
+ if (deleteArgs.json) {
76001
76001
  const container = await ApplicationsService.deleteApplication(
76002
76002
  deleteArgs.ID
76003
76003
  );
@@ -76005,22 +76005,37 @@ async function deleteCommand2(deleteArgs, _config) {
76005
76005
  return;
76006
76006
  }
76007
76007
  startSection("Delete your container");
76008
- const yes = await inputPrompt({
76009
- question: "Are you sure that you want to delete these containers? The associated DO container will lose access to the containers.",
76010
- type: "confirm",
76011
- label: ""
76012
- });
76013
- if (!yes) {
76014
- cancel("The operation has been cancelled");
76015
- return;
76008
+ if (isInteractive2()) {
76009
+ const yes = await inputPrompt({
76010
+ question: "Are you sure that you want to delete these containers? The associated DO container will lose access to the containers.",
76011
+ type: "confirm",
76012
+ label: ""
76013
+ });
76014
+ if (!yes) {
76015
+ cancel("The operation has been cancelled");
76016
+ return;
76017
+ }
76016
76018
  }
76017
76019
  const [, err] = await wrap2(
76018
76020
  ApplicationsService.deleteApplication(deleteArgs.ID)
76019
76021
  );
76020
76022
  if (err) {
76021
- throw new UserError(
76023
+ if (err instanceof ApiError) {
76024
+ if (err.status === 400 || err.status === 404) {
76025
+ const body = JSON.parse(err.body);
76026
+ throw new UserError(
76027
+ `There has been an error deleting the container.
76028
+ ${body.error}`
76029
+ );
76030
+ }
76031
+ throw new Error(
76032
+ `There has been an unknown error deleting the container.
76033
+ ${JSON.stringify(err.body)}`
76034
+ );
76035
+ }
76036
+ throw new Error(
76022
76037
  `There has been an internal error deleting your containers.
76023
- ${err.message}`
76038
+ ${err.message}`
76024
76039
  );
76025
76040
  }
76026
76041
  endSection("Your container has been deleted");