Skip to content

Conversation

@wnqqnw19
Copy link
Contributor

@wnqqnw19 wnqqnw19 commented Dec 8, 2025

Description

This PR improves code quality and consistency in bittensor/core/errors.py.

Changes Made:

  1. Added all export list: Defines the public API for the errors module and improves clarity on which exceptions are intended for external use.
  2. Reorganized exception definitions: Moved BalanceTypeError and BalanceUnitMismatchError from the end of the file to after MaxAttemptsException for better logical grouping.
  3. Standardized docstring formatting: Converted single-line docstrings to multi-line format (triple-quoted strings) for consistency across chain transaction error classes.
  4. Fixed SynapseDendriteNoneException initialization bug:
    • Now properly sets self.synapse attribute before calling the parent constructor
    • Ensures the synapse parameter is correctly passed to the parent SynapseException class
  5. Removed redundant aliases: Cleaned up unnecessary alias assignments that were already imported from async_substrate_interface.errors.

Impact:

  • Better code organization and maintainability
  • Fixed potential bug in SynapseDendriteNoneException
  • Improved API clarity with all list
  • Consistent documentation style

Copy link
Collaborator

@basfroman basfroman left a comment

Choose a reason for hiding this comment

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

Revert docstings changes for existing errors.

Comment on lines 313 to 314
self.synapse = synapse
super().__init__(self.message, self.synapse)
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you read you changes? Why is this here? We don't need to store synapse as class attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've fixed them @basfroman

@basfroman basfroman merged commit fb887f3 into opentensor:SDKv10 Dec 9, 2025
614 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.

2 participants