[PATCH conductor 4/8] Log any errors encountered during image import

Matt Wagner matt.wagner at redhat.com
Tue Dec 13 19:09:50 UTC 2011


---
 src/app/controllers/images_controller.rb |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
index 9b6ade9..cb5c48b 100644
--- a/src/app/controllers/images_controller.rb
+++ b/src/app/controllers/images_controller.rb
@@ -79,8 +79,9 @@ class ImagesController < ApplicationController
     begin
       image = Image.import(provider, params[:image_id])
       flash[:success] = t("images.import.image_imported")
-      redirect_to image_url(image) and return
-    rescue
+      redirect_to image_url(image.id) and return
+    rescue Exception => e
+      logger.error "Caught exception importing image: #{e.message}"
       flash[:error] = t("images.import.image_not_imported")
       redirect_to new_image_url(:tab => 'import')
     end
-- 
1.7.6.4




More information about the aeolus-devel mailing list