Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
0 replies
-
@578223592 In Java, Exceptions are usually passed along and then caught somewhere to handle the errors. In Rust, I also adopt a similar approach. The error handling in Rust and Java has both differences and similarities. I'm still thinking about how to handle errors better in this project. If you have any better ideas, we can discuss them together. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi, I'm sorry to disturb you. I would like to ask what considerations led to using Result to implement runtime exceptions instead of maintaining similar behavior to the Java version, i.e., directly causing a panic. For example:
java version:
rust version
The reason for my confusion is that if an Err is returned instead of directly panic, it may lead to inconsistent behavior between the two versions. In fact, I noticed that after an error occurs, the Rust version continues to run, which indeed leads to some differences from the Java version:
link:
https://github.com/578223592/rocketmq-rust/blob/43e0d24fd356b81eae55cf2213acd75ddc3a43bc/rocketmq-broker/src/topic/manager/topic_config_manager.rs#L495
Beta Was this translation helpful? Give feedback.
All reactions