-
Notifications
You must be signed in to change notification settings - Fork 56
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
Enhance Error Execution Utilities: Add Retry, Timeout, Cancellation, and Advanced Error Handling #130
Comments
@zriyanshdz Can you please look into this issue? |
@UTSAVS26 have you run/tested the code and made the analysis based on the code structure? We would really appreciate if you can start contribution with the same. |
Hello @shubham19may , Yeah, I’ve gone through the current code, and I see where the new features could fit in. Here’s where I think these updates would be useful:
Let me know how you'd like to go about it! |
@shubham19may I have raised PR for this issue #153 |
File:
utils/error.go
Problem
Right now, the error execution utilities (
ErrExec
,ErrExecSequential
) work fine, but they’re missing some important features that would make them way more useful in real-world applications. Specifically, they don't support:Without these features, it’s harder to handle failures, especially in complex systems or processes that involve retries, cancellations, or need better error tracking.
Solution
To improve the current utilities, we could add the following features:
Timeout and Cancellation Support: Modify the existing concurrent execution function to allow cancelling or timing out tasks, so that if something goes wrong or takes too long, we can stop it early.
Retry Logic: Add a way to automatically retry failed functions a certain number of times, with some time in between, before giving up on them. This is super useful when dealing with temporary failures like network issues.
Better Error Handling: Improve the sequential execution function to allow more flexible error handling, like stopping early if a critical error occurs, or limiting how many errors we accumulate before quitting.
Consistent Function Signatures: Make sure all the functions have a similar structure and return types, so they're easier to use together in larger projects.
Optional Logging or Metrics: Add optional features for logging or tracking metrics, so we can monitor how these functions are performing and debug issues more easily.
These updates will make the utilities way more robust and easier to work with, especially in production systems where reliability is key.
The text was updated successfully, but these errors were encountered: