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

Improve error handling for missing Provider configurations #283

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

mrtmm
Copy link
Contributor

@mrtmm mrtmm commented Apr 12, 2024

Throw a ProviderException when a provider configuration is missing but the Provider is linked to an existing Stack.

@mrtmm mrtmm force-pushed the non-existent-provider-errors branch from ec3d895 to 7845880 Compare April 15, 2024 11:41
@mrtmm mrtmm marked this pull request as ready for review April 15, 2024 11:42
@mrtmm mrtmm requested a review from fghaas April 15, 2024 11:43
@@ -66,6 +66,9 @@ def init(name):
return OpenstackProvider(name, config, sleep_seconds)
elif provider_type == "gcloud":
return GcloudProvider(name, config, sleep_seconds)
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's suboptimal that we end up with the same exception type with the same message in two different code paths, as it complicates troubleshooting. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, perhaps yes. I updated the error message now.

Throw a ProviderException when a provider configuration is missing
but the Provider is linked to an excisting Stack.
@mrtmm mrtmm force-pushed the non-existent-provider-errors branch from 7845880 to acd0d3e Compare April 15, 2024 13:32
Copy link
Contributor

@fghaas fghaas left a comment

Choose a reason for hiding this comment

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

Looks good to me now, thanks!

@mrtmm mrtmm merged commit acd0d3e into hastexo:master Apr 15, 2024
14 checks passed
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.

None yet

2 participants