-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
In a production environment, panic! may not be a good choice. #54
Comments
Thank you for your issue! I believe there are |
I want to encapsulate the use of LOCALES.lookup_with_args in a Linux service. Sometimes, due to programming negligence, the name of the arguments may be written incorrectly, but this will not result in a compilation error. Instead, it will cause a runtime crash, which is not very user-friendly. Implementing compilation errors might be difficult, but directly printing error messages is a better approach as it allows for easy identification of the error, without the need to run the program multiple times to see the crash information. |
The mentioned try_ function has left me a bit confused. Does the library provide such a function? Could you please provide an example? Thank you. |
Even with |
Wanted to provide some feedback that this change is needed. When hot reloading translations that has an invalid translation this panic is triggered even when calling try_ family method. With #63 hot reloading even with invalid translations works nicely, i can handle error correctly. I am using this feature daily. |
In a production environment, panic! may not be a good choice. Can we directly return the error message as a string, i.e., change the code from
to
The text was updated successfully, but these errors were encountered: