mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-10-22 07:22:33 +00:00
Include manifest name in protobuf decode errors.
This commit is contained in:
+2
-1
@@ -236,6 +236,7 @@ func (fs *FSBackend) GetManifest(
|
||||
}
|
||||
manifest, err = DecodeManifest(data)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("decode %s: %w", name, err)
|
||||
return
|
||||
}
|
||||
return manifest, ManifestMetadata{
|
||||
@@ -508,7 +509,7 @@ func (fs *FSBackend) QueryAuditLog(ctx context.Context, id AuditID) (*AuditRecor
|
||||
if data, err := fs.auditRoot.ReadFile(id.String()); err != nil {
|
||||
return nil, fmt.Errorf("read: %w", err)
|
||||
} else if record, err := DecodeAuditRecord(data); err != nil {
|
||||
return nil, fmt.Errorf("decode: %w", err)
|
||||
return nil, fmt.Errorf("decode %s: %w", id, err)
|
||||
} else {
|
||||
if _, err := fs.auditRoot.Stat(auditDetachedName(id)); err == nil {
|
||||
record.Manifest = nil
|
||||
|
||||
@@ -469,6 +469,7 @@ func (l s3ManifestLoader) load(
|
||||
|
||||
manifest, err := DecodeManifest(data)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("decode %s: %w", name, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -904,6 +905,7 @@ func (s3 *S3Backend) QueryAuditLog(ctx context.Context, id AuditID) (*AuditRecor
|
||||
|
||||
record, err := DecodeAuditRecord(data)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("decode %s: %w", id, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user