mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Better error on signing csr twice
This commit is contained in:
parent
85b6ea913e
commit
4388be15d6
2 changed files with 8 additions and 2 deletions
|
@ -55,11 +55,16 @@ class Certificate < ActiveRecord::Base
|
|||
self.crt = crt_file.read
|
||||
save!
|
||||
else
|
||||
errors.add(:base, I18n.t('failed_to_create_certificate'))
|
||||
logger.error('FAILED TO CREATE CLIENT CERTIFICATE')
|
||||
if err.match(/TXT_DB error number 2/)
|
||||
errors.add(:base, I18n.t('failed_to_create_crt_csr_already_signed'))
|
||||
logger.error('CSR ALREADY SIGNED')
|
||||
else
|
||||
errors.add(:base, I18n.t('failed_to_create_certificate'))
|
||||
end
|
||||
logger.error(err)
|
||||
# rubocop:disable Rails/Output
|
||||
puts "Certificate sign issue: #{err.inspect}" if Rails.env.test?
|
||||
puts "Certificate sign issue: #{err.inspect}" if Rails.env.test?
|
||||
# rubocop:enable Rails/Output
|
||||
return false
|
||||
end
|
||||
|
|
|
@ -732,3 +732,4 @@ en:
|
|||
you_have_a_new_invoice: 'You have a new invoice.'
|
||||
sincerely: 'Sincerely'
|
||||
expiry: 'Expiry'
|
||||
failed_to_create_crt_csr_already_signed: 'Failed to create certificate: CSR is already signed'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue