copiousfreetime/launchy — pull request #77 by infertux (2014-01-12 09:42:30+00:00)
Title: Don't swallow errors when Launchy fails to run a command

In the rare case when `exec` fails to run the command - typically when the file cannot be opened raising `Errno::ENOENT` - Launchy would raise an exception but not showing any output. As you can imagine it makes debugging quite tricky (it took me a while to track it down from my Rails app's `ActiveRecord::Base#save!` call to [Letter Opener](https://github.com/ryanb/letter_opener) to eventually Launchy).

This fix restores `$stderr` with the `STDERR` constant then raises the exception which outputs something like this for instance:

```
/home/infertux/.rvm/gems/ruby-2.0.0-p353/gems/launchy-2.4.0/lib/launchy/detect/runner.rb:121:in `exec': No such file or directory - elinks (Errno::ENOENT)
from /home/infertux/.rvm/gems/ruby-2.0.0-p353/gems/launchy-2.4.0/lib/launchy/detect/runner.rb:121:in `block in wet_run'
[...]
```

---

The underlying error is that Launchy tries to run `elinks` which is set through my `BROWSER` environment variable but I didn't install elinks yet (new machine). I would not consider this a bug in Launchy since my `BROWSER` variable is supposed to be correct and I think it's fine to let Launchy blow up in this case.