试卷当版本库异常时的处理

dev_hs
SylorHuang 6 years ago
commit d2b691228e

@ -34,8 +34,7 @@ module GitHelper
rescue Exception => e
Rails.logger.error(e.message)
Rails.logger.error("#####__________文档内容获取异常")
# raise Educoder::TipException.new("文档内容获取异常")
raise Educoder::TipException.new("文档内容获取异常")
end
end

@ -484,7 +484,11 @@ module ExercisesHelper
game_code = game_challenge
code = game_code.try(:new_code)
else
code = git_fle_content(game.myshixun.repo_path,cha_path)
begin
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -31,8 +31,9 @@ json.shixun_detail do
if shixun_challenge.challenge&.path.present?
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
if latest_code.to_s == "true"
begin
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
latest_code = ""
end
else

@ -149,7 +149,12 @@ namespace :excellent_course_exercise do
game_code = game_challenge
code = game_code.try(:new_code)
else
code = git_fle_content(game.myshixun.repo_path,cha_path)
begin #8-23,hs
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
# code = git_fle_content(game.myshixun.repo_path,cha_path)
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

Loading…
Cancel
Save