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

@ -43,11 +43,11 @@ module Epp
@notification = current_user.unread_notifications.find_by(id: params[:parsed_frame].css('poll').first['msgID'])
unless @notification
epp_errors << {
code: '2303',
msg: I18n.t('message_was_not_found'),
value: { obj: 'msgID', val: params[:parsed_frame].css('poll').first['msgID'] }
}
epp_errors.add(:epp_errors,
code: '2303',
msg: I18n.t('message_was_not_found'),
value: { obj: 'msgID',
val: params[:parsed_frame].css('poll').first['msgID'] })
handle_errors and return
end