diff options
| author | Luc Donnet | 2015-05-20 13:34:32 +0200 |
|---|---|---|
| committer | Luc Donnet | 2015-05-20 13:34:32 +0200 |
| commit | d54aad9538e9452498c8d5a98628f4af2d9f87c5 (patch) | |
| tree | 41fa9159638f0255cbefcd9039bccc7c94f5db6a /app/controllers/exports_controller.rb | |
| parent | 57945951bdd6a2b861d2b799eca22aadee8b81a4 (diff) | |
| download | chouette-core-d54aad9538e9452498c8d5a98628f4af2d9f87c5.tar.bz2 | |
Integration of failure for iev and use faraday exception in controller Bug Refs #0035646
Diffstat (limited to 'app/controllers/exports_controller.rb')
| -rw-r--r-- | app/controllers/exports_controller.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index 68ee00568..80c70902e 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -13,9 +13,9 @@ class ExportsController < ChouetteController index! do build_breadcrumb :index end - rescue Ievkit::Error => error + rescue Ievkit::Error, Faraday::Error => error logger.error("Iev failure : #{error.message}") - flash[:error] = t('iev.failure') + flash[:error] = t('iev.exception.default') redirect_to referential_path(@referential) end end @@ -25,9 +25,9 @@ class ExportsController < ChouetteController show! do build_breadcrumb :show end - rescue Ievkit::Error => error + rescue Ievkit::Error, Faraday::Error => error logger.error("Iev failure : #{error.message}") - flash[:error] = t('iev.failure') + flash[:error] = t('iev.exception.default') redirect_to referential_path(@referential) end end @@ -35,9 +35,9 @@ class ExportsController < ChouetteController def destroy begin destroy! - rescue Ievkit::Error => error + rescue Ievkit::Error, Faraday::Error => error logger.error("Iev failure : #{error.message}") - flash[:error] = t('iev.failure') + flash[:error] = t('iev.exception.default') redirect_to referential_path(@referential) end end @@ -49,9 +49,9 @@ class ExportsController < ChouetteController OpenURI::Buffer.const_set 'StringMax', 0 begin send_file open(resource.file_path), { :type => "application/#{resource.filename_extension}", :disposition => "attachment", :filename => resource.filename } - rescue Ievkit::Error => error + rescue Ievkit::Error, Faraday::Error => error logger.error("Iev failure : #{error.message}") - flash[:error] = t('iev.failure') + flash[:error] = t('iev.exception.default') redirect_to referential_path(@referential) end end |
