-
Notifications
You must be signed in to change notification settings - Fork 317
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
chore: use errors.New to replace fmt.Errorf with no parameters #4113
Conversation
Signed-off-by: ChengenH <[email protected]>
📝 WalkthroughWalkthroughThe changes in this pull request involve modifications to error handling in two Go files: Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Minter
participant Params
User->>Minter: Call Validate()
Minter->>Minter: Check BondDenom
alt BondDenom is empty
Minter-->>User: Return errors.New("bond denom cannot be empty")
end
User->>Params: Call validateGasPerBlobByte()
Params->>Params: Check GasPerBlobByte
alt GasPerBlobByte is 0
Params-->>User: Return errors.New("gas per blob byte cannot be 0")
end
User->>Params: Call validateGovMaxSquareSize()
Params->>Params: Check GovMaxSquareSize
alt GovMaxSquareSize is 0
Params-->>User: Return errors.New("gov max square size cannot be zero")
end
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🔇 Additional comments (5)x/blob/types/params.go (3)
Clean addition of the errors package for the new error handling approach.
Good replacement of fmt.Errorf with errors.New for a static error message.
Good replacement of fmt.Errorf with errors.New for a static error message. x/mint/types/minter.go (2)
Clean addition of the errors package for the new error handling approach.
Good replacement of fmt.Errorf with errors.New for a static error message. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is a style choice. I would prefer if a linter was configured so that the codebase always used fmt.Errorf
so that this codebase is consistent.
IMO if it's a style choice and it isn't enforced via a linter then I'm inclined to not merge this b/c nothing prevents a future PR from using fmt.Errorf
without arguments.
No description provided.