Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/src/pcluster/models/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ def _validate_and_parse_config(
except ConfigValidationError as e:
raise e
except Exception as e:
if "Invalid type for parameter InstanceTypes[0], value: None, type: <class 'NoneType'>" in e.__str__():
Copy link
Contributor

Choose a reason for hiding this comment

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

The logici around exception raising should not be based on error messages, as it is a fragile approach. Error messages are meant to change over time.
The logic should be based on something more stable, such as exception types.

raise ConfigValidationError(f"Invalid cluster configuration: Capacity reservation does not exist.")
raise ConfigValidationError(f"Invalid cluster configuration: {e}")

return config, validation_failures
Expand Down
Loading