mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Add epp errors tto the concern itself
This commit is contained in:
parent
d4775ba5c5
commit
e15fed2cd0
5 changed files with 19 additions and 7 deletions
|
@ -94,7 +94,7 @@ module Epp
|
|||
end
|
||||
|
||||
def handle_errors(obj = nil)
|
||||
@errors ||= []
|
||||
@errors ||= ActiveModel::Errors.new(self)
|
||||
|
||||
if obj
|
||||
obj.construct_epp_errors
|
||||
|
|
|
@ -55,13 +55,13 @@ module Epp
|
|||
|
||||
def renew
|
||||
authorize! :renew, Epp::Contact
|
||||
epp_errors << { code: '2101', msg: t(:'errors.messages.unimplemented_command') }
|
||||
epp_errors.add(:epp_errors, code: '2101', msg: t(:'errors.messages.unimplemented_command'))
|
||||
handle_errors
|
||||
end
|
||||
|
||||
def transfer
|
||||
authorize! :transfer, Epp::Contact
|
||||
epp_errors << { code: '2101', msg: t(:'errors.messages.unimplemented_command') }
|
||||
epp_errors.add(:epp_errors, code: '2101', msg: t(:'errors.messages.unimplemented_command'))
|
||||
handle_errors
|
||||
end
|
||||
|
||||
|
|
|
@ -44,7 +44,10 @@ module Epp
|
|||
update_params = ::Deserializers::Xml::DomainUpdate.new(params[:parsed_frame],
|
||||
registrar_id).call
|
||||
action = Actions::DomainUpdate.new(@domain, update_params, false)
|
||||
(handle_errors(@domain) and return) unless action.call
|
||||
unless action.call
|
||||
handle_errors(@domain)
|
||||
return
|
||||
end
|
||||
|
||||
pending = @domain.epp_pending_update.present?
|
||||
render_epp_response("/epp/domains/success#{'_pending' if pending}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue