|
|
|
|
|
by Ygg2
284 days ago
|
|
> That's actually the same as Java, with its "checked exceptions" (aka listed in function signatures), and the RunTimeException hierachy which don't have to be listed. You are correct, but the logic is inverted. Most anticipated errors in Rusts are handled by Result. Errors that aren't anticipated i.e. panics, crash the thread, and if it's the main thread the program. In Java terms, Rust has return value as error, which can be thought as checked exceptions; and Error class in Java that just kills your program. Stuff isn't as clean cut ofc because Rust has allowed panics to be caught by main thread. |
|