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 errors definition and docs #433

Merged
merged 29 commits into from
May 23, 2024
Merged

Conversation

open-junius
Copy link
Contributor

Description

Right now a lot of the errors returned by subtensor extrinsics are fairly generic substrate errors. We want these to be as granular / descriptive as possible, so an audit of what errors we are returning should be conducted and we should create new error types and/or utilize existing descriptive ones wherever possible

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

@open-junius open-junius self-assigned this May 17, 2024
@open-junius open-junius added the blue team defensive programming, CI, etc label May 17, 2024
@open-junius open-junius marked this pull request as ready for review May 21, 2024 16:38
pallets/admin-utils/src/lib.rs Show resolved Hide resolved
pallets/collective/src/lib.rs Outdated Show resolved Hide resolved
pallets/collective/src/lib.rs Show resolved Hide resolved
pallets/collective/src/lib.rs Show resolved Hide resolved
pallets/collective/src/lib.rs Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@rajkaramchedu rajkaramchedu left a comment

Choose a reason for hiding this comment

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

I think I reviewed most error comments. But I didn't quite understand what this is trying to say: https://github.com/opentensor/subtensor/pull/433/files#diff-1d0c66ee439b9d6f7f2d63b75825a63ca6af50725485830095562b200aadbf6cR193

pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
pallets/subtensor/src/errors.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@rajkaramchedu rajkaramchedu left a comment

Choose a reason for hiding this comment

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

See my suggestions. Approving. Terrific work! Your work in this PR alone will lift up the user experience considerbly, thanks!

pallets/collective/src/tests.rs Outdated Show resolved Hide resolved
pallets/admin-utils/src/lib.rs Show resolved Hide resolved
@open-junius open-junius merged commit 1e1ba1b into development May 23, 2024
9 checks passed
@open-junius open-junius deleted the junius/detailed-error-type branch May 23, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blue team defensive programming, CI, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error granularity
3 participants