From: Niki Roo Date: Sun, 3 May 2020 13:50:51 +0000 (+0200) Subject: import book: fix onFailure never called X-Git-Tag: fanfix-swing-1.1.1~13 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=78e588084f9063c8b955090287ad1c38183616e4;p=fanfix-swing.git import book: fix onFailure never called --- diff --git a/src/be/nikiroo/fanfix_swing/Actions.java b/src/be/nikiroo/fanfix_swing/Actions.java index a4b57708..849d3ace 100644 --- a/src/be/nikiroo/fanfix_swing/Actions.java +++ b/src/be/nikiroo/fanfix_swing/Actions.java @@ -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;