-
Notifications
You must be signed in to change notification settings - Fork 1
Allow expected HTTP status codes #151
Copy link
Copy link
Closed
Labels
dx-ideaFeature idea generated by idea-generatorFeature idea generated by idea-generatorenhancementNew feature or requestNew feature or requestideaFeature idea from the idea pipelineFeature idea from the idea pipeline
Description
Activity
Metadata
Metadata
Assignees
Labels
dx-ideaFeature idea generated by idea-generatorFeature idea generated by idea-generatorenhancementNew feature or requestNew feature or requestideaFeature idea from the idea pipelineFeature idea from the idea pipeline
Problem
Automation often needs to treat 404, 409, or 202 as valid. Today
azd resthas generic exit codes documented inweb/src/pages/reference.astro. Scripts have to parse output or relax error handling when an Azure API returns an expected status outside 2xx.Proposed solution
Add a persistent
--allow-statusflag incli/src/internal/cmd/root.goandconfig.Config. Accept comma-separated exact codes and ranges like200-204,404. In the client response handling, return success when the response status matches while still printing the response body. Keep current behavior when the flag is omitted, and document the flag on the reference page.User impact
People writing provisioning and cleanup scripts can handle idempotent cases without brittle shell workarounds. This is most useful for existence checks, create-if-missing flows, and cleanup commands.
Acceptance criteria
--allow-status 404exits 0 for a 404 response and still writes the response body using the selected format.200-204,409are accepted, and invalid specs return exit code 2 with a clear error.Notes
Complexity: S • Priority: 5