mirror of https://github.com/pulumi/pulumi.git
2bd42e99b4
When trying to download a ZIP (e.g. for an AI response in pulumi new), we currently don't check the response code, and just feed whatever we are getting from the server into the zip parser. The AI at the same time response with a 500 if the program it generated is not valid, which is always a possibility with LLMs. This results in confusing error messages when the AI fails to generate a correct program: "error: failed to retrieve zip archive: zip: not a valid zip file". We can do better here, and check the error code. Helpfully Pulumi AI also tells us what is wrong in the response body, so we can include that in the error message. This results in an error message like (in a failing example I tried): ``` error: failed to retrieve zip archive: failed to download template: 500 Internal Server Error Missing , or : between flow sequence items at line 30, column 20: subnetIDs: [${subnet1.id}] ^ ``` This can help the user refine the prompt, and gives them at least a bit more information on why the AI generation failed. Fixes https://github.com/pulumi/pulumi/issues/15644 |
||
---|---|---|
.. | ||
config.go | ||
creds.go | ||
creds_test.go | ||
loaders.go | ||
loaders_test.go | ||
paths.go | ||
paths_test.go | ||
plugins.go | ||
plugins_install_nodejs_test.go | ||
plugins_install_python_test.go | ||
plugins_install_test.go | ||
plugins_test.go | ||
project.go | ||
project.json | ||
project_test.go | ||
settings.go | ||
templates.go | ||
templates_test.go | ||
templates_zip.go | ||
templates_zip_test.go | ||
workspace.go |