mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Introduce new epp error api #2588
This commit is contained in:
parent
8ed8687691
commit
ea5a2e54fb
2 changed files with 16 additions and 2 deletions
|
@ -8,6 +8,18 @@ class EppController < ApplicationController
|
|||
before_action :latin_only
|
||||
before_action :validate_request
|
||||
before_action :update_epp_session
|
||||
|
||||
around_action :catch_epp_errors
|
||||
def catch_epp_errors
|
||||
err = catch(:epp_error) do
|
||||
yield
|
||||
nil
|
||||
end
|
||||
return unless err
|
||||
@errors = [err]
|
||||
handle_errors
|
||||
end
|
||||
|
||||
helper_method :current_user
|
||||
|
||||
rescue_from StandardError do |e|
|
||||
|
|
|
@ -617,8 +617,10 @@ class Epp::Domain < Domain
|
|||
def reject_transfer(frame, current_user)
|
||||
pt = pending_transfer
|
||||
if current_user.registrar != pt.transfer_from
|
||||
add_epp_error('2304', nil, nil, I18n.t('transfer_can_be_rejected_only_by_current_registrar'))
|
||||
return false
|
||||
throw :epp_error, {
|
||||
msg: I18n.t('transfer_can_be_rejected_only_by_current_registrar'),
|
||||
code: '2304'
|
||||
}
|
||||
end
|
||||
|
||||
transaction do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue