chore: add more diagnostic output to dbfs Stat error (#11525)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11525
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
Mathieu Fenniak 2026-03-06 06:43:33 +01:00 committed by Michael Kriese
parent b8dac67364
commit 7fdb31c8ef

View file

@ -61,7 +61,7 @@ func WriteLogs(ctx context.Context, filename string, offset int64, rows []*runne
stat, err := f.Stat()
if err != nil {
return nil, fmt.Errorf("dbfs Stat %q: %w", name, err)
return nil, fmt.Errorf("WriteLogs(name=%q, offset=%d, len(rows)=%d): dbfs Stat: %w", name, offset, len(rows), err)
}
if stat.Size() < offset {
// If the size is less than offset, refuse to write, or it could result in content holes.