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