diff --git a/source/net/filebot/format/BindingException.java b/source/net/filebot/format/BindingException.java index ff2c1803..11a6f89e 100644 --- a/source/net/filebot/format/BindingException.java +++ b/source/net/filebot/format/BindingException.java @@ -11,7 +11,7 @@ public class BindingException extends RuntimeException { } public BindingException(String binding, String innerMessage, Throwable cause) { - this(String.format("BindingException: \"%s\": %s", binding, innerMessage), cause); + this(String.format("Binding \"%s\": %s", binding, innerMessage), cause); } } diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 35618e7f..4fc4be84 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -862,10 +862,10 @@ public class MediaBindingBean { return mediaFile; } - private void checkMediaFile() throws RuntimeException { + private void checkMediaFile() { // make sure file is not null, and that it is an existing file if (mediaFile == null) { - throw new RuntimeException("Path to media file not set. Click (x)= and select a sample file."); + throw new IllegalStateException("Path to media file not set. Click (x)= and select a sample file."); } } diff --git a/source/net/filebot/resources/status.info.png b/source/net/filebot/resources/status.info.png new file mode 100755 index 00000000..e7646b14 Binary files /dev/null and b/source/net/filebot/resources/status.info.png differ diff --git a/source/net/filebot/ui/rename/FormatDialog.java b/source/net/filebot/ui/rename/FormatDialog.java index cab87065..bcbb6dbf 100644 --- a/source/net/filebot/ui/rename/FormatDialog.java +++ b/source/net/filebot/ui/rename/FormatDialog.java @@ -63,7 +63,6 @@ import javax.swing.text.BadLocationException; import net.filebot.ResourceManager; import net.filebot.Settings; import net.filebot.UserFiles; -import net.filebot.WebServices; import net.filebot.format.BindingException; import net.filebot.format.ExpressionFormat; import net.filebot.format.MediaBindingBean; @@ -544,9 +543,14 @@ public class FormatDialog extends JDialog { } catch (CancellationException e) { // ignore, cancelled tasks are obsolete anyway } catch (Exception e) { - BindingException bindingException = findCause(e, BindingException.class); - status.setText(bindingException != null ? getMessage(bindingException) : String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage())); - status.setIcon(ResourceManager.getIcon("status.warning")); + BindingException issue = findCause(e, BindingException.class); + if (issue != null) { + status.setText(getMessage(issue)); + status.setIcon(ResourceManager.getIcon("status.info")); + } else { + status.setText(String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage())); + status.setIcon(ResourceManager.getIcon("status.warning")); + } status.setVisible(true); } finally { preview.setVisible(preview.getText().trim().length() > 0);