You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2011/06/08 17:32:47 UTC
[PATCH 1/4] * server/server.rb: load default drive on startup
From: David Lutterkort <lu...@redhat.com>
This makes the server fail early if there is a problem with the driver
Signed-off-by: David Lutterkort <lu...@redhat.com>
---
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
Re: [PATCH 1/4] * server/server.rb: load default drive on startup
Posted by Michal Fojtik <mi...@mifo.sk>.
On Jun 8, 2011, at 5:32 PM, lutter@redhat.com wrote:
> From: David Lutterkort <lu...@redhat.com>
>
> 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 <lu...@redhat.com>
> ---
> 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
>