From 7a19b509e883e92d45ac32292bc82d6bdff50231 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 22 Jul 2015 09:50:24 +0300 Subject: [PATCH 1/2] Notify airbrake for epp errors --- app/controllers/epp_controller.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 269b83f1e..3fec7910b 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -40,9 +40,18 @@ class EppController < ApplicationController }] end - logger.error e.message - logger.error e.backtrace.join("\n") - # TODO: NOITFY AIRBRAKE / ERRBIT HERE + if Rails.env.test? || Rails.env.development? + # rubocop:disable Rails/Output + puts e.backtrace.reverse.join("\n") + puts "\nFROM-EPP-RESCUE: #{e.message}\n" + # rubocop:enable Rails/Output + else + logger.error "FROM-EPP-RESCUE: #{e.message}" + logger.error e.backtrace.join("\n") + + # TODO: NOITFY AIRBRAKE / ERRBIT HERE + NewRelic::Agent.notice_error(e) + end end render_epp_response '/epp/error' From 1b831fc6298cbdbe6dfd8c903a8c7b544ba814e1 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 22 Jul 2015 11:30:36 +0300 Subject: [PATCH 2/2] Fix double error message when domain too long in EPP #2695 --- app/controllers/epp/domains_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/epp/domains_controller.rb b/app/controllers/epp/domains_controller.rb index ccf1ce736..c7713e3e6 100644 --- a/app/controllers/epp/domains_controller.rb +++ b/app/controllers/epp/domains_controller.rb @@ -25,6 +25,7 @@ class Epp::DomainsController < EppController @domain = Epp::Domain.new_from_epp(params[:parsed_frame], current_user) handle_errors(@domain) and return if @domain.errors.any? @domain.valid? + @domain.errors.delete(:name_dirty) if @domain.errors[:puny_label].any? handle_errors(@domain) and return if @domain.errors.any? handle_errors and return unless balance_ok?('create')