Limit and remove panic usage in the code. #7409
Labels
C:errors
T:tech debt
Tech debt that should be cleaned up
Type: Code Hygiene
General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Summary
There are many (a lot!) places in the SDK code which are susceptible for panics.
The general Go recommendation is to not use panics whenever possible.
Problem Definition
We should avoid panics whenever possible. The Go team deliberately limited the exception mechanism for good reasons: they are not designed to rigorously check code on each step and can leave an app in a wrong state if not managed properly.
From Go FAQ:
Rob Pike on a "Proposal for an exception-like mechanism"
Proposal
Look through the code and remove panics wherever possible.
testing.T.Fail / Fatal
methods.panic
log.Fatal
Discussions
Incremental issues
For Admin Use
The text was updated successfully, but these errors were encountered: