mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Merge pull request #1952 from internetee/html-error-returned-for-invalid-epp-xml-request
added errors handler
This commit is contained in:
commit
e3edf78aa3
4 changed files with 30 additions and 3 deletions
|
@ -23,6 +23,8 @@ module Epp
|
|||
rescue_from ActiveRecord::RecordNotFound, with: :respond_with_object_does_not_exist_error
|
||||
before_action :set_paper_trail_whodunnit
|
||||
|
||||
skip_before_action :validate_against_schema
|
||||
|
||||
protected
|
||||
|
||||
def respond_with_command_failed_error(exception)
|
||||
|
@ -103,7 +105,7 @@ module Epp
|
|||
@errors += obj.errors[:epp_errors]
|
||||
end
|
||||
|
||||
if params[:parsed_frame].at_css('update')
|
||||
if params[:parsed_frame]&.at_css('update')
|
||||
@errors.each_with_index do |errors, index|
|
||||
if errors[:code] == '2304' &&
|
||||
errors[:value].present? &&
|
||||
|
@ -113,7 +115,6 @@ module Epp
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
@errors.uniq!
|
||||
|
||||
render_epp_response '/epp/error'
|
||||
|
|
|
@ -6,5 +6,10 @@ module Epp
|
|||
epp_errors << { code: params[:code], msg: params[:msg] }
|
||||
render_epp_response '/epp/error'
|
||||
end
|
||||
|
||||
def command_handler
|
||||
epp_errors << { code: '2000', msg: 'Unknown command' }
|
||||
render_epp_response '/epp/error'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue