-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
remove panic & wrapping informational error #501
Conversation
Codecov Report
@@ Coverage Diff @@
## main #501 +/- ##
==========================================
- Coverage 50.61% 48.98% -1.63%
==========================================
Files 64 64
Lines 5751 5985 +234
==========================================
+ Hits 2911 2932 +21
- Misses 2471 2615 +144
- Partials 369 438 +69
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Thanks for your contribution.
I think the interface has changed only for the function below:
- validation.RegisterValidation
- validation.RegisterTranslation
- config.configPath
- time.ParseDuration
Next, it would be nice to remove the panic that can occur in CRDT data structure.
- Currently, if error occurred in CRDT logic, server was shutdown because of `panic()` method - Removed `panic()` methods & Change all errors able to logging
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.
Thanks for the second work. I leave a few comments.
We need to check whether an actual error can occur
While removing panic, some interfaces have been changed to return an error. The changes may reduce the usability of interfaces, It is necessary to check whether an actual error can occur.
For example, there is a situation like below:
An error chain Text.String > RGATreeSplitNode.String > TextValue.String
need not return an actual error.
func (t *TextValue) String() (string, error) {
return t.value, nil
}
What this PR does / why we need it:
ref. https://github.com/uber-go/guide/blob/master/style.md#dont-panic
Remove
panic()
in server productionRemove panic method & Wrapping errors in CRDT logics
panic()
methodpanic()
methods & Change all errors able to loggingWhich issue(s) this PR fixes:
Fixes #497
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: