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

Add handling for when Instance_id is passed, but is Invalid #7

Open
dheerajoruganty opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@dheerajoruganty
Copy link
Collaborator

dheerajoruganty commented Sep 30, 2024

Description:

If an Instance_id is passed and it is invalid (e.g., the instance does not exist, has been terminated, or the Instance_id format is incorrect), the process currently fails and stops execution.

Scenarios Where This Might Occur:

  • A previously created instance has been terminated or deleted but its Instance_id is still referenced.
  • An incorrectly formatted or non-existent Instance_id is passed.
  • The Instance_id belongs to a different region than the one the API is targeting.

Steps to Reproduce:

  1. Pass an invalid Instance_id to an API call.
  2. Observe the process halt due to an error response from the API.

Expected Behavior:

  • The system should catch the error if the Instance_id is invalid.
  • The error should be logged with sufficient details (e.g., invalid ID, reason for failure).
  • The script should skip the invalid Instance_id and continue with other valid instances.

Possible Solutions:

  • Implement try-catch (or equivalent) error handling for operations involving Instance_id.
  • When an invalid Instance_id is detected, log the error, and move on to the next instance.
  • Ensure that the error handling works across different operations (e.g., start, stop, terminate, etc.).

Relevant Code/Section:

Add error handling to the get_instance_details EC2 API

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

No branches or pull requests

1 participant