logoalt Hacker News

jiehonglast Sunday at 10:37 PM1 replyview on HN

I suppose Java exceptions have the same issues, albeit with automatic stack traces, obviously:

- the ? keyword is replaced either by runtime exceptions and so each function do it transpires you don’t catch it, or by simply stating the raised exception in the signature

- message can be overloaded for humans

- the exception type itself is the structured data, but in practice it seldom contains structured data and most logic depends on the exception type.

Make of this what you will, but I didn’t say it’s great.


Replies

imtringuedlast Monday at 9:34 AM

Java has nested exceptions, which significantly reduces the problem, since there is going to be at least one relevant exception that will help you figure it out. In the worst case you can just paste the stack trace into your GitHub issue and call it a day.

With Rust, having a generic error bubble up without nesting means you don't even know where it went wrong. The error could be from any generic error source.