Scala doesn't use checked exceptions, so if they are not documented, it could be anything. That's kinda true anyway....
No, I'm saying if you don't see documented exceptions then it's a flaw of the documentation.
I've been meaning to sweep through the std. Lib and help document things more. If you open tickets, it'll give me areas to focus on.
But ... the client programmer still needs to know what to catch, regardless of whether there are checked exceptions.
Are you saying this is a design choice, not to document exceptions?
There's a big issue with such a tool. Do you always want us to document that out of memory, interruption, linkage errors can happen to any method, anywhere?
No, it's a subset you care about. Like for scala.io.Source you want to know what to do with IOExceptions, as you already know a whole host of JVM exceptions could be thrown.
How is a tool supposed to understand *that*. Now the tool could look for direct throw clauses, but that doesn't help when using java libraries.
"Ah", you say, "It can pull direct throws and checked java exceptions". What about IllegalArgumentException, or other unchecked validation messages?
Basically, they need a human to document what they are, why they are thrown and how to recover. Otherwise you still have to treat them as a black box "O NOES".
That doesn't mean a tool wouldn't be useful. I think it's worth an effort. However the results still need to be curated by a human.
Note: we haven't done a doc spree in a while, but perhaps we should do one where we just document exceptions would be excellent.
- Josh
I'm a really big fan of automation tools, though, so anything that automates is going to help. Maybe something could be done with macros?
I'm a really big fan of automation tools, though, so anything that automates is going to help. Maybe something could be done with macros?
Probably not macros ... but shouldn't the compiler be able to at least create the list of possible thrown exceptions for us (minus the "usual" ones)? (Josh?)
Yes please, effect system! (One general enough to handle units of measurement also, thank you!)
I think it's also been mentioned, it would be interesting if the code examples in scaladoc comments were actually runnable tests.