Skip to content

Commit

Permalink
added logs to exception
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Nov 25, 2024
1 parent 959ac0a commit 748a146
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/models/contact/company_register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ def company_is_relevant?
end

def return_company_status
company_register_2 = CompanyRegister::Client.new
Rails.logger.info "ident: #{ident}"
Rails.logger.info "org?: #{org?}"
# Rails.logger.info "return_company_data: #{return_company_data.inspect}"
return_company_data_2 = company_register_2.simple_data(registration_number: ident)
Rails.logger.info "return_company_data_2: #{return_company_data_2.inspect}"
return if return_company_data_2.blank?
Rails.logger.info "return_company_data: #{return_company_data.inspect}"

return_company_data_2.first[:status]
return if return_company_data.blank?

return_company_data.first[:status]
end

def return_company_data
return unless org?

company_register.simple_data(registration_number: ident)
rescue CompanyRegister::NotAvailableError
Rails.logger.info "ERROR HAPPENED: CompanyRegister::NotAvailableError"
[]
end

Expand Down

0 comments on commit 748a146

Please sign in to comment.