Open github0013 opened 2 years ago
One idea I'm considering is to make listen
work optionally with the escalate gem. That gem provides a hook for escalating exceptions. I wouldn't want to have a hard dependency, but perhaps if it's been required by the time the listen
code is running, it could use that hook.
@github0013 What do you think? If you could register an escalate
callback to intercept these exceptions, would that do what you need?
@github0013 Any opinion here?
@github0013 Just checking in here. Any opinions above? Is this ticket is worth keeping open?
@ColinDKelley
Sory I had been on a busy project, and I couldn't come back to github at all. Let me look into escalate gem and get back to you.
@github0013 Ok, thanks. And no pressure to use that gem! I'm open to any alternatives.
I checked the issues, and I found this https://github.com/guard/listen/pull/535 . It should be the same error?
Environments
Reproduction
Let this run.
Then touch a file.
And I get this in the console.
I need to catch the exception the listen block raises, so I can safely stop the main thread, but it seems the runtime error is not rescuable as above. (not going through
puts "rescued #{ex.message}"
part)I tried this https://github.com/guard/listen/issues/362#issuecomment-170323804
Thread.main.wakeup
but it's only good when the main thread is sleeping. (if it's blocking by file access or whatnot, it doesn't work)