Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when Project ID is invalid #559

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

mcasperson
Copy link
Contributor

@mcasperson mcasperson commented Oct 20, 2023

Issue #556 describes a scenario where assigning an invalid project ID to a deployment process causes the TF provider to crash. This PR catches the case where the project returned by the invalid project ID is nil and displays an error rather than crashing.

The result now looks like this:

╷
│ Error: Octopus API error: Resource is not found or it doesn't exist in the current space context. Please contact your administrator for more information. [] 
│ 
│   with octopusdeploy_deployment_process.this,
│   on bug.tf line 54, in resource "octopusdeploy_deployment_process" "this":
│   54: resource "octopusdeploy_deployment_process" "this" {
│ 
╵

@mcasperson mcasperson requested a review from zentron October 20, 2023 02:53
Copy link
Contributor

@johnsimons johnsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcasperson mcasperson merged commit faf3715 into main Oct 20, 2023
6 checks passed
@mcasperson mcasperson deleted the mattc/fix_crash_invalid_project_id branch October 20, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants