From d5abaa608998429529a79b6891b5fc484c8817c7 Mon Sep 17 00:00:00 2001 From: Luis Uguina Date: Sat, 16 May 2020 18:56:57 +1000 Subject: [PATCH] Fix: ugly JavaException when failing to generate thumbnail in SWING client (#224) --- .../sheepit/client/standalone/swing/activity/Working.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/sheepit/client/standalone/swing/activity/Working.java b/src/com/sheepit/client/standalone/swing/activity/Working.java index b4343cd8..7b317db3 100644 --- a/src/com/sheepit/client/standalone/swing/activity/Working.java +++ b/src/com/sheepit/client/standalone/swing/activity/Working.java @@ -47,6 +47,7 @@ import com.sheepit.client.Client; import com.sheepit.client.Job; +import com.sheepit.client.Log; import com.sheepit.client.Stats; import com.sheepit.client.Utils; import com.sheepit.client.standalone.GuiSwing; @@ -75,6 +76,7 @@ public class Working implements Activity { private JLabel user_info_total_rendertime_this_session_value; private JLabel userInfoQueuedUploadsAndSizeValue; private String currentTheme; + private Log log; public Working(GuiSwing parent_) { parent = parent_; @@ -97,6 +99,7 @@ public Working(GuiSwing parent_) { userInfoQueuedUploadsAndSizeValue = new JLabel("0"); currentTheme = UIManager.getLookAndFeel().getName(); // Capture the theme on component instantiation previousStatus = ""; + log = Log.getInstance(parent_.getConfiguration()); } @Override @@ -382,8 +385,9 @@ else if (idInt < 20) { icon = new ImageIcon(img.getScaledInstance((int) (width * factor), (int) (height * factor), Image.SCALE_FAST)); } catch (IOException e) { - System.out.println("Working::showLastRender() exception " + e); - e.printStackTrace(); + log.error(String.format("Working::showLastRender() Unable to load/preview rendered frame [%s]. Exception %s", + lastJob.getOutputImagePath(), + e.getMessage())); } }