Closed sideninja closed 3 months ago
The recent updates enhance error handling across the codebase by centralizing error management within the models/errors
package. This restructuring simplifies error reporting, distinguishing between user errors and logical errors, while improving clarity in transaction validation and refining logging mechanisms. The changes aim to reduce noise in metrics and logs, ultimately leading to better maintainability and a more robust user experience.
Files Group | Change Summary |
---|---|
api/api.go , api/models.go , api/server.go , bootstrap/bootstrap.go , services/ingestion/subscriber.go , services/requester/cross-spork_client.go , services/requester/pool.go , services/requester/requester.go |
Enhanced error handling by centralizing error definitions in the models/errors package, leading to clearer transaction validation and logging. Removed checks for certain error types to streamline the process. |
api/encode_transaction.go , api/pull.go , api/ratelimiter.go , models/engine.go , models/engine_test.go , storage/index_testsuite.go , storage/pebble/accounts.go , storage/pebble/blocks.go , storage/pebble/receipts.go , storage/pebble/storage.go , storage/storage_test.go |
Updated import paths to source errors from models/errors , indicating a reorganization for better error management. |
models/errors/errors.go |
Introduced comprehensive error definitions and structured error handling functionalities for improved clarity and usability across the application. |
services/logs/filter.go , services/logs/filter_test.go |
Switched error handling to utilize new definitions from the models/errors package, enhancing clarity in logging and testing. |
Objective | Addressed | Explanation |
---|---|---|
Improve error reporting (Issue #350) | ✅ | |
Distinguish between user errors and logical errors (Issue #350) | ✅ | |
Handle non-existing API endpoints (Issue #350) | ✅ | |
Provide invalid block numbers, block range, hash etc. (Issue #350) | ✅ | |
Fetching non-existing entities (Issue #350) | ❓ | Unclear if all scenarios for non-existing entities have been addressed. |
🐇 Oh, errors of yore, now refined,
With models as guides, our paths aligned.
No more confusion, just clarity bright,
A hop and a skip, we embrace the light.
Through logs and metrics, we dance with glee,
For user and system, all errors now free! 🌟
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?
Closes: #350
Description
This PR improves how we handle errors and more importantly not log errors that are user errors (invalid inputs).
For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
FailedTransaction
andInvalidTransaction
.Bug Fixes
Chores
models
package, improving code organization.Tests
blockStorage
andreceiptStorage
functions in tests for better clarity.