Skip to content

Conversation

@Tofel
Copy link
Contributor

@Tofel Tofel commented Oct 22, 2025

This pull request focuses on improving error messages and making them more actionable throughout the seth package. It replaces the usage of the github.com/pkg/errors library with Go's standard fmt.Errorf, and revises error handling to provide clearer guidance and troubleshooting steps for users. The changes affect configuration validation, contract ABI lookup, block statistics, and client initialization, making it easier for developers to diagnose and resolve common issues.

Error message improvements and actionable guidance:

  • Replaced generic error messages with detailed, user-friendly messages across configuration validation, contract ABI lookup, and block statistics logic in seth.go, abi_finder.go, and block_stats.go. These messages now include troubleshooting steps and links to documentation or issue trackers where relevant. [1] [2] [3] [4] [5] [6]

Error handling and library updates:

  • Removed all usages of github.com/pkg/errors and replaced them with standard fmt.Errorf, simplifying imports and error wrapping throughout the codebase. [1] [2] [3] [4]

Client initialization and configuration validation:

  • Enhanced error messages in client creation functions (NewClientWithConfig, NewClientRaw) to clarify configuration issues, RPC connectivity problems, and contract mapping errors, providing actionable next steps for users. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Documentation:

  • Added a changelog entry summarizing the review and improvement of error messages, highlighting their increased clarity and actionability.

Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

This patch aims to improve error handling and messaging across the Seth library, particularly focusing on providing more actionable feedback and ensuring compatibility with updated dependencies.

What

  • Error Handling Enhancements: Replaced the usage of github.com/pkg/errors with Go's standard errors package and custom error formatting to provide clearer, more actionable error messages.
  • Dependency Updates: Removed unnecessary dependencies to streamline the package and avoid potential conflicts.
  • Configuration Validation: Added checks and informative messages for configuration-related errors, ensuring users are aware of misconfigurations.
  • Transaction Handling: Improved the clarity of messages related to transaction processing, gas estimation, and nonce management, helping users diagnose and resolve issues more efficiently.
  • Code Refactoring: Minor refactoring for better readability and maintenance, including simplifying error handling patterns and updating function signatures to align with best practices.

Specific Changes Include:

  • Replaced github.com/pkg/errors with standard errors package for error wrapping.
  • Enhanced error messages across the library to include suggestions for resolution.
  • Added validation for configuration settings, with clear errors if invalid values are detected.
  • Improved logging and error reporting during transaction processing, including gas estimation and nonce management.
  • Streamlined dependency usage by removing unnecessary imports.
  • Minor refactoring for improved code clarity and maintainability.

@Tofel Tofel force-pushed the dx-2128-seth-better-error-msgs branch from 0d05ec3 to 90fa726 Compare October 23, 2025 15:31
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.

1 participant