deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/3] Core: Return 404 instead of exception when accessing non-existing driver in drivers collection
Date Wed, 01 Feb 2012 13:55:20 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/server.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
index 9801d60..57b7daa 100644
--- a/server/lib/deltacloud/server.rb
+++ b/server/lib/deltacloud/server.rb
@@ -167,7 +167,7 @@ EOS
         @providers = driver.providers(credentials)  if driver.respond_to? :providers
       end
       @driver = settings.drivers[@name]
-      return [404, "Driver #{@name} not found"] unless @driver
+      halt 404 unless @driver
       respond_to do |format|
         format.xml { haml :"drivers/show" }
         format.json { @driver.to_json }
-- 
1.7.4.4


Mime
View raw message