diff --git a/app/controllers/epp/errors_controller.rb b/app/controllers/epp/errors_controller.rb index b0da5473c..43b8ee6b1 100644 --- a/app/controllers/epp/errors_controller.rb +++ b/app/controllers/epp/errors_controller.rb @@ -3,4 +3,9 @@ class Epp::ErrorsController < EppController epp_errors << { code: params[:code], msg: params[:msg] } render_epp_response '/epp/error' end + + def not_found + epp_errors << { code: 2400, msg: t('could_not_determine_object_type_check_xml_format_and_namespaces') } + render_epp_response '/epp/error' + end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 5e17ae60c..3ad01a110 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -496,3 +496,4 @@ en: request_params: 'Request params' repp_log: 'REPP log' repp_logs: 'REPP logs' + could_not_determine_object_type_check_xml_format_and_namespaces: 'Could not determine object type. Check XML format and namespaces.' diff --git a/config/routes.rb b/config/routes.rb index 58f4c2020..74eb1ba9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ Rails.application.routes.draw do post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll) post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay) + post 'command/:command', to: 'errors#not_found' # fallback route + get 'error/:command', to: 'errors#error' end