guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.91k stars 245 forks source link

issue #509: raise Listen::Error::INotifyMaxWatchesExceeded rather than abort #545

Closed ColinDKelley closed 2 years ago

ColinDKelley commented 2 years ago

Fix for issue #509:

ColinDKelley commented 2 years ago

BTW, I'm expecting to release this in v3.7.0 in the coming week.

ColinDKelley commented 2 years ago

@ioquatix I carried the exception across from the old warning message. I like that it points to the documentation. How would you simplify it? Were you thinking of putting it all on one line maybe? And maybe drop some superfluous words like FATAL and error? How about:

Listen gem unable to monitor directories for changes because iNotify max watches exceeded. See: #{README_URL}
ioquatix commented 2 years ago

I think the exception message shouldn't contain documentation. So, I'd just say "Max watches exceeded!".

Personally, I don't mind either approach, but if you start adding URLs to exception messages, surely that should apply to all exceptions? So, it's hard to know where to draw the line. Perhaps having documentation on the exception class which explains what to do to mitigate it.

ColinDKelley commented 2 years ago

I don't see any downside to the exception including a link to documentation on how to resolve the problem! The reason we don't do it all the time is that it's a lot of work. ;) In this case, someone before me already did it, and I confirmed that the link still works (since I refactored it into the README a couple months ago) so I think we're good. I will trim it down to the more succinct version, though.