Use errors as first-class objects

This commit is contained in:
Alex Sherman 2021-05-04 13:44:11 +05:00
parent 72c865e656
commit d4775ba5c5
8 changed files with 146 additions and 186 deletions

View file

@ -3,12 +3,12 @@ module Epp
skip_authorization_check
def error
epp_errors << { code: params[:code], msg: params[:msg] }
epp_errors.add(:epp_errors, code: params[:code], msg: params[:msg] )
render_epp_response '/epp/error'
end
def command_handler
epp_errors << { code: '2000', msg: 'Unknown command' }
epp_errors.add(:epp_errors, code: '2000', msg: 'Unknown command' )
render_epp_response '/epp/error'
end
end