mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 08:18:52 -05:00
* Display BindingException class error messages as "info" type messages instead of "warning" type, so users will understand that these messages are to be expected for some formats in some cases, and can be safely ignored
This commit is contained in:
parent
6238500d29
commit
bd5a5a6fc6
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
source/net/filebot/resources/status.info.png
Executable file
BIN
source/net/filebot/resources/status.info.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user