mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-01 07:09:21 +01:00
Backport #21064 We should only log CheckPath errors if they are not simply due to context cancellation - and we should add a little more context to the error message. Fix #20709 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
c83a05f114
commit
1f804d35ca
2 changed files with 2 additions and 4 deletions
|
@ -191,8 +191,8 @@ func (c *CheckAttributeReader) Run() error {
|
||||||
// CheckPath check attr for given path
|
// CheckPath check attr for given path
|
||||||
func (c *CheckAttributeReader) CheckPath(path string) (rs map[string]string, err error) {
|
func (c *CheckAttributeReader) CheckPath(path string) (rs map[string]string, err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil && err != c.ctx.Err() {
|
||||||
log.Error("CheckPath returns error: %v", err)
|
log.Error("Unexpected error when checking path %s in %s. Error: %v", path, c.Repo.Path, err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -1448,8 +1448,6 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff
|
||||||
} else if language, has := attrs["gitlab-language"]; has && language != "unspecified" && language != "" {
|
} else if language, has := attrs["gitlab-language"]; has && language != "unspecified" && language != "" {
|
||||||
diffFile.Language = language
|
diffFile.Language = language
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Error("Unexpected error: %v", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue