--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Wed Jan 30 19:48:18 2019 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Sun Feb 03 08:16:08 2019 -0500
@@ -52,18 +52,19 @@
params -> "",
(s, p) -> s);
- public File bundle(Map<String, ? super Object> params, File outdir) {
+ public File bundle(Map<String, ? super Object> params,
+ File outdir) throws PackagerException {
Log.verbose(MessageFormat.format(I18N.getString("message.building-dmg"),
APP_NAME.fetchFrom(params)));
if (!outdir.isDirectory() && !outdir.mkdirs()) {
- throw new RuntimeException(MessageFormat.format(
- I18N.getString("error.cannot-create-output-dir"),
- outdir.getAbsolutePath()));
+ throw new PackagerException(
+ "error.cannot-create-output-dir",
+ outdir.getAbsolutePath());
}
if (!outdir.canWrite()) {
- throw new RuntimeException(MessageFormat.format(
- I18N.getString("error.cannot-write-to-output-dir"),
- outdir.getAbsolutePath()));
+ throw new PackagerException(
+ "error.cannot-write-to-output-dir",
+ outdir.getAbsolutePath());
}
File appImageDir = APP_IMAGE_BUILD_ROOT.fetchFrom(params);
@@ -85,7 +86,7 @@
return null;
} catch (IOException ex) {
Log.verbose(ex);
- return null;
+ throw new PackagerException(ex);
}
}
@@ -472,8 +473,8 @@
}
@Override
- public File execute(
- Map<String, ? super Object> params, File outputParentDir) {
+ public File execute(Map<String, ? super Object> params,
+ File outputParentDir) throws PackagerException {
return bundle(params, outputParentDir);
}