gemstash icon indicating copy to clipboard operation
gemstash copied to clipboard

Errors are hidden in daemonized mode

Open smellsblue opened this issue 8 years ago • 5 comments

If there is an error on startup, it is sometimes hidden when running in daemonized mode, while it will be visible running in non-daemonized mode.

Example: write a plugin against the plugins branch, have the initialization throw an error, then run in both daemonized mode and non-daemonized mode.

smellsblue avatar Dec 22 '15 00:12 smellsblue

Kinda hard to fix. A daemonized process losses access to stdout and stderr by design. If we are writing the errors to the log, that's pretty much as far as we can go.

pcarranza avatar Dec 30 '15 12:12 pcarranza

I wonder if there is some top level hook for exceptions, similar to at_exit... we might be able to use that if there is, or maybe the best we can do is wrap around plugin initialization with a begin/rescue

smellsblue avatar Dec 30 '15 18:12 smellsblue

That's OK and something that makes sense. But still you don't have stdout/stderr when daemonized..

I would vote for at_exit and then checking of there is an error raised.

pcarranza avatar Dec 30 '15 18:12 pcarranza

Yeah, I meant we should log any error we detect (the problem I had was I kept looking at the log and not seeing any error, yet my gemstash server wasn't working)

smellsblue avatar Dec 30 '15 18:12 smellsblue

Right, then yes. at_exit

pcarranza avatar Dec 30 '15 18:12 pcarranza