From 9bc34ed9ef4da159ae0bd9e499810f67385f03a5 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Mon, 25 Jan 2016 14:37:43 +0200 Subject: [PATCH] Story#105846070 - save error to json obj --- app/controllers/registrant/domains_controller.rb | 3 ++- app/models/soap/arireg.rb | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 445cc5d42..c2c406de7 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -44,7 +44,8 @@ class Registrant::DomainsController < RegistrantController begin BusinessRegistryCache.fetch_associated_domains ident, ident_cc rescue Soap::Arireg::NotAvailableError => error - flash[:notice] = I18n.t(error.message[:message]) + flash[:notice] = I18n.t(error.json[:message]) + Rails.error.fatal("[EXCEPTION] #{error.to_s}") current_user.domains end end diff --git a/app/models/soap/arireg.rb b/app/models/soap/arireg.rb index 35517c3ef..5c8db3475 100644 --- a/app/models/soap/arireg.rb +++ b/app/models/soap/arireg.rb @@ -46,8 +46,11 @@ module Soap class Arireg class NotAvailableError < StandardError + attr_accessor :json def initialize(params) params[:message] = "#{I18n.t(:business_registry_service_not_available)}" unless params.key? :message + @json = params + super(params) end end