-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix: Proper error handling #81
Comments
We know that all errors should not close our app with os error. There are two approaches to dealing with errors: first, top-down:
second way, down-top: I suggest the first one. |
Let's go with the top-down approach. |
@harpy-wings this should be done after merging #84, you should branch out from #84. You'll have to rebase after the merge if you branch out from |
we should use Error Wrapping, err := doSomething()
if err != nil {
return errors.Join(err,errors.New("unexpected failure))
} note that it may not be required to use the same thing everywhere. sometimes a simple return is better. |
also, there is a dependency on refactoring since an error should be returned instead of panic or log. and we need to change the function's interface for all of the packages. |
duo to #107 all panic are replaced, but we should consider error handling in the next PRs. |
There are a lot of places in the code where we just
panc(err)
. That shouldn't be the case; we need to handle these errors properly.The text was updated successfully, but these errors were encountered: