On Jun 8, 2011, at 5:32 PM, [email protected] wrote:

> From: David Lutterkort <[email protected]>
> 
> This makes the server fail early if there is a problem with the driver

ACK.

Nice catch! It could be also used for reporting missing driver gems.
Eg. we can wrap it with 'begin..rescue...end' and check for FileNotFound
exception and then report meaningful messages to user about missing gems.

  -- Michal

> 
> Signed-off-by: David Lutterkort <[email protected]>
> ---
> server/server.rb |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/server/server.rb b/server/server.rb
> index e332679..0cd4945 100644
> --- a/server/server.rb
> +++ b/server/server.rb
> @@ -45,6 +45,8 @@ configure do
>   set :show_exceptions, false
>   set :views, File.dirname(__FILE__) + '/views'
>   set :public, File.dirname(__FILE__) + '/public'
> +  # Try to load the driver on startup to fail early if there are issues
> +  driver
> end
> 
> configure :development do
> -- 
> 1.7.4.4
> 

Reply via email to