新增:更改文件内容错误返回

This commit is contained in:
yystopf 2026-03-30 17:26:57 +08:00
parent 82f9ddef6e
commit c20bd19796
1 changed files with 7 additions and 0 deletions

View File

@ -65,6 +65,13 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
error("#{filepath}文件已存在,不能重复创建!")
end
end
when 500
Rails.logger.error("Gitea api url==#{url},status:#{status},body=#{body}")
if json_parse!(body)["message"].present? && json_parse!(body)["message"].include?("PushRejected Error")
error("提交被拒绝,分支被锁定,请稍后重试。")
else
error("系统错误!")
end
else
Rails.logger.error("Gitea api url==#{url},status:#{status},body=#{body}")
error("系统错误!")