Skip to content

Conversation

@mkoura
Copy link
Collaborator

@mkoura mkoura commented Nov 7, 2025

Replaces all instances of raising AssertionError with ValueError for invalid argument or state errors across the codebase. This improves clarity and aligns with Python's standard exception usage for value validation. FileNotFoundError is used where appropriate for missing files. No functional changes to logic or error messages.

Replaces all instances of raising AssertionError with ValueError for
invalid argument or state errors across the codebase. This improves
clarity and aligns with Python's standard exception usage for value
validation. FileNotFoundError is used where appropriate for missing
files. No functional changes to logic or error messages.
@mkoura mkoura requested a review from Copilot November 7, 2025 13:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling by replacing AssertionError with more semantically appropriate exception types for input validation scenarios.

  • Replaces AssertionError with ValueError for input validation errors across all modules
  • Replaces AssertionError with FileNotFoundError for a file existence check in clusterlib_helpers.py

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cardano_clusterlib/txtools.py Updated 4 input validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/transaction_group.py Updated 11 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/stake_pool_group.py Updated 1 parameter validation error to raise ValueError instead of AssertionError
cardano_clusterlib/stake_address_group.py Updated 6 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/query_group.py Updated 2 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/gov_vote_group.py Updated 4 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/gov_group.py Updated 1 parameter validation error to raise ValueError instead of AssertionError
cardano_clusterlib/gov_drep_group.py Updated 3 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/gov_committee_group.py Updated 3 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/gov_action_group.py Updated 4 parameter validation errors to raise ValueError instead of AssertionError
cardano_clusterlib/clusterlib_helpers.py Updated file existence check to raise FileNotFoundError instead of AssertionError
cardano_clusterlib/address_group.py Updated 2 parameter validation errors to raise ValueError instead of AssertionError

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mkoura mkoura merged commit 93e95ef into master Nov 7, 2025
9 checks passed
@mkoura mkoura deleted the rm_assertion_errors branch November 7, 2025 14:19
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.

2 participants