diff --git a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb index b66765df8..d4b3421ef 100644 --- a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb +++ b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb @@ -29,8 +29,13 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController end params[:school][:depts].each do |dns| - send_request(dns, @ask_question, @ask_reply) + begin + send_request(dns, @ask_question, @ask_reply) + rescue URI::InvalidURIError + next + end end unless params[:school].nil? + redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success') end @@ -59,6 +64,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController response = http.request(request) # binding.pry if response.code != "200" + # Think about another rescue method. new_status = "轉介其他單位" current_reply.update_attributes(status: new_status) else