Integrated: 8287397 : Print top-level exception when snippet fails to read file

Anthony Vanelverdinghe duke at openjdk.org
Thu Dec 8 10:24:19 UTC 2022


On Sun, 22 May 2022 06:28:39 GMT, Anthony Vanelverdinghe <duke at openjdk.org> wrote:

> When using a snippet as follows (on Windows): `{@snippet file=baz\Baz.java }`, javadoc prints the error:
> 
> src\foo\foo\Foo.java:14: error: Error reading file: baz\Baz.java
> {@snippet file=baz\Baz.java }
>           ^
>         (null)
> 
> 
> which is unhelpful. So rather than printing the exception's cause (which is `null` in the example above), it seems better to print the top-level exception itself.
> 
> PS: I'll need help from someone to create a JBS issue & sponsor this PR

This pull request has now been integrated.

Changeset: 297bf6a5
Author:    Anthony Vanelverdinghe <dev at anthonyv.be>
Committer: Julian Waters <jwaters at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/297bf6a5965c4f01ca2091976b5e6ca675ab5395
Stats:     2 lines in 1 file changed: 0 ins; 0 del; 2 mod

8287397: Print top-level exception when snippet fails to read file

Reviewed-by: jjg

-------------

PR: https://git.openjdk.org/jdk/pull/8826


More information about the javadoc-dev mailing list