Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Fix: ugly JavaException when failing to generate thumbnail in SWING c…
Browse files Browse the repository at this point in the history
…lient (#224)
  • Loading branch information
luguina authored May 16, 2020
1 parent 91edd37 commit d5abaa6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/com/sheepit/client/standalone/swing/activity/Working.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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_;
Expand All @@ -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
Expand Down Expand Up @@ -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()));
}
}

Expand Down

0 comments on commit d5abaa6

Please sign in to comment.