You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the late reply and thanks for your advice.
I have checked the code and i have used panic in four palces, thoes panics are used in the following situations:
Some codes that only used by the library itself, here, the panic is more like the assert, in order to make sure that some internal data can match the requirements. Maybe assert is better, i will update them in the next version.
Some APIs cannot be called under certain data conditions, even if an exception is returned to the developer, it is not easy to do further processing.
This is my understanding of some situations where using panic to throw an error is more logical than returning an exception, maybe my understanding is not very thorough and there may be a better way to deal with it. If you have good suggestions, please feel free to point them out. Thanks again for your feedback.
In rust if we panicked, everything's break. There's no way to work around that, at least in straightforward manners.
Since it's a library, the user cannot predictably do stuff safely because the library can panic and user cannot handle it at all
The text was updated successfully, but these errors were encountered: