krasa / GrepConsole

IntelliJ plugin - https://plugins.jetbrains.com/plugin/7125
Apache License 2.0
437 stars 57 forks source link

java.io.FileNotFoundException if the watched file is being deleted #105

Closed JThoennes closed 6 years ago

JThoennes commented 6 years ago

IntelliJ IDEA 2017.3.4 (Community Edition) Build #IC-173.4548.28, built on January 30, 2018 JRE: 1.8.0_152-release-1024-b11 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.9.0-5-amd64

Grep Console Version: 7.3.162.000.0

If the watched file is deleted, IDEA reports an error which is annoying. I think that the plugin could handle such cases more gracefully.


java.lang.RuntimeException: java.io.FileNotFoundException: /home/jthoennes/work/git/pms-platform/whitelabel-pms/release/log/whitelabel-order-management.log (No such file or directory)
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:117)
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:110)
    at krasa.grepconsole.action.OpenFileInConsoleAction.openFileInConsole(OpenFileInConsoleAction.java:49)
    at krasa.grepconsole.action.OpenFileInConsoleAction$2.run(OpenFileInConsoleAction.java:69)
    at krasa.grepconsole.tail.TailContentExecutor$RerunAction.actionPerformed(TailContentExecutor.java:250)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:193)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:151)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:344)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:646)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.FileNotFoundException: /home/jthoennes/work/git/....log (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:112)
    ... 41 more```
krasa commented 6 years ago

sure

krasa commented 6 years ago

Fixed by bfc8e63ea45c1f0974e67b4269d605879a254241