Rescue URI Error
This commit is contained in:
parent
21009961ef
commit
1305b9f1ef
|
@ -29,8 +29,13 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
|||
end
|
||||
|
||||
params[:school][:depts].each do |dns|
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue