import book: fix onFailure never called
authorNiki Roo <niki@nikiroo.be>
Sun, 3 May 2020 13:50:51 +0000 (15:50 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 3 May 2020 13:50:51 +0000 (15:50 +0200)
src/be/nikiroo/fanfix_swing/Actions.java

index a4b57708524bed3d8e86fdf048ed8e3678d5a454..849d3ace1bdef84430b7f6c5c62e6fd79d7c4edf 100644 (file)
@@ -251,11 +251,13 @@ public class Actions {
                                try {
                                        Instance.getInstance().getLibrary().imprt(getUrl(url), pg);
                                        pg.done();
+                                       
                                        if (onSuccess != null) {
                                                onSuccess.run();
                                        }
                                } catch (IOException e) {
                                        pg.done();
+                                       
                                        if (e instanceof UnknownHostException) {
                                                UiHelper.error(parent,
                                                                Instance.getInstance().getTransGui().getString(
@@ -273,6 +275,10 @@ public class Actions {
                                                                                .getString(StringIdGui.TITLE_ERROR),
                                                                e);
                                        }
+
+                                       if (onFailure != null) {
+                                               onFailure.run();
+                                       }
                                }
 
                                return null;