OK so the following does work. But my peace of mind is shattered, because why would a try block make the IO error simply vanish? Surely, if the error was there, it should now be reported?
The error you saw is at compile-time, not run-time. In order for your code to use Jsoup, it must handle the exception, otherwise your code is invalid. Adding a try-catch makes the code valid, so you get no compile-time error. You are seeing no runtime error because there never was a runtime error – but there could be, and now your code would handle it as required.
Java has a feature called “checked exceptions”. That means that there are certain kinds of exceptions, namely those that subclass Exception but not RuntimeException, such that if a method may throw them, it must list them in its throws declaration, say: void readData() throws IOException. IOException is one of those. Thus, when you are calling a method that lists IOException in its throws declaration, you must either list it in your own throws declaration or catch it. java - Why do I get the "Unhandled exception type IOException"? - Stack Overflow