1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-14 05:15:03 -05:00

Improved logging when bad license text is passed in

This commit is contained in:
Reinhard Pointner 2019-06-19 00:30:54 +07:00
parent f912e6b8c3
commit fa8f4d3380
2 changed files with 9 additions and 5 deletions

View File

@ -22,10 +22,10 @@ import net.filebot.UserFiles.FileChooser;
import net.filebot.cli.ArgumentBean;
import net.filebot.util.PreferencesList;
import net.filebot.util.PreferencesMap;
import net.filebot.util.SystemProperty;
import net.filebot.util.PreferencesMap.JsonAdapter;
import net.filebot.util.PreferencesMap.PreferencesEntry;
import net.filebot.util.PreferencesMap.StringAdapter;
import net.filebot.util.SystemProperty;
import net.filebot.util.ui.SwingEventBus;
public final class Settings {
@ -148,8 +148,9 @@ public final class Settings {
public static void configureLicense(File file) {
try {
configureLicense(findClearSignMessage(readTextFile(file)));
} catch (Exception e) {
configureLicense(readTextFile(file));
} catch (Throwable e) {
debug.severe(e::toString);
log.severe("Invalid License File: " + e.getMessage());
}
}
@ -158,7 +159,9 @@ public final class Settings {
try {
log.info(importLicense(findClearSignMessage(text)) + " has been activated successfully.");
} catch (Throwable e) {
log.severe("License Error: " + e.getMessage());
debug.severe(e::toString);
debug.severe(text);
log.severe("Invalid License File: " + e.getMessage());
}
// make sure license is validated and cached

View File

@ -6,6 +6,7 @@ import static net.filebot.util.RegularExpressions.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -62,7 +63,7 @@ public class PGP {
return matcher.group();
}
throw new IllegalArgumentException("PGP SIGNED MESSAGE not found");
throw new NoSuchElementException("PGP SIGNED MESSAGE not found");
}
}