A few improvements for jpackage error reporting:
1. jpackage error messages were improved inJDK-8372359. But an update to the "message.error-header" l10n key [1] was missed.
The value of the "message.error-header" l10n key should be "Error: {0}" instead of the current "{0}".
2. jpackage will not print the stack trace of an exception unless executed with the --verbose option.
This is correct behavior for exceptions explicitly created in jpackage code. These exceptions should have messages sufficient to understand the cause of the failure. However, it this approach hides essential information about failures caused by bugs in jpackage code. Say it is an NPE caused by "Optional.of(...)". It doesn't have a message. When jpackage prints it in non-verbose mode, the only output it produces is:
---
java.lang.NullPointerException
---
Not helpful. For internal errors, jpackage must always print a stack trace. This behavior was discovered when working on another patch with bogus changes to jpackage that caused an NPE.
[1] https://github.com/openjdk/jdk/blob/f52d49925f9c60814a0a34720d7443e748b35c25/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties#L51
1. jpackage error messages were improved in
The value of the "message.error-header" l10n key should be "Error: {0}" instead of the current "{0}".
2. jpackage will not print the stack trace of an exception unless executed with the --verbose option.
This is correct behavior for exceptions explicitly created in jpackage code. These exceptions should have messages sufficient to understand the cause of the failure. However, it this approach hides essential information about failures caused by bugs in jpackage code. Say it is an NPE caused by "Optional.of(...)". It doesn't have a message. When jpackage prints it in non-verbose mode, the only output it produces is:
---
java.lang.NullPointerException
---
Not helpful. For internal errors, jpackage must always print a stack trace. This behavior was discovered when working on another patch with bogus changes to jpackage that caused an NPE.
[1] https://github.com/openjdk/jdk/blob/f52d49925f9c60814a0a34720d7443e748b35c25/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties#L51
- relates to
-
JDK-8372359 Clean jpackage error messages
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/28833