ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Handle invalid config.ru more gracefully #31

Closed ledbettj closed 10 years ago

ledbettj commented 11 years ago

If an application's config.ru is malformed (for example, missing a run or map), Rack::Builder.parse_file() throws an exception.

There's no user feedback in this case except the following repeatedly dumped to the log file:

D, [2013-07-23T10:37:26.208799 #22351] DEBUG -- : Building Rack app at /path/to/app/config.ru

In my case I made a stupid typo in my rackup file and ended up with a 3.5GB log file containing the above over and over.

ysbaddaden commented 11 years ago

Yes, we must address failures!

It should have been taken care of there: https://github.com/ysbaddaden/prax/blob/master/lib/racker/handler.rb#L25

But the app is now built in Racker::Server and passed to the handler. So we must rescue there, too: https://github.com/ysbaddaden/prax/blob/master/lib/racker/server.rb#L38

ysbaddaden commented 10 years ago

That is now be addressed in unstable branch.

ledbettj commented 10 years ago

Thanks!