Recover from IllegalStateException when polling clipboard.
This commit is contained in:
parent
33dfa1f073
commit
b5ee49c9db
@ -10,6 +10,8 @@ import java.util.Set;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.rarchives.ripme.App.logger;
|
||||||
|
|
||||||
public class ClipboardUtils {
|
public class ClipboardUtils {
|
||||||
private static AutoripThread autoripThread = new AutoripThread();
|
private static AutoripThread autoripThread = new AutoripThread();
|
||||||
|
|
||||||
@ -33,6 +35,9 @@ public class ClipboardUtils {
|
|||||||
.getDefaultToolkit()
|
.getDefaultToolkit()
|
||||||
.getSystemClipboard()
|
.getSystemClipboard()
|
||||||
.getData(DataFlavor.stringFlavor);
|
.getData(DataFlavor.stringFlavor);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("Caught and recovered from IllegalStateException: " + e.getMessage());
|
||||||
} catch (HeadlessException e) {
|
} catch (HeadlessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (UnsupportedFlavorException e) {
|
} catch (UnsupportedFlavorException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user