Skip to content

Commit

Permalink
extension errors must provide full context
Browse files Browse the repository at this point in the history
  • Loading branch information
flotter committed Aug 28, 2024
1 parent a7ae9ba commit 22040e0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internals/plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,7 @@ func CombineLayers(layers ...*Layer) (*Layer, error) {
var err error
combined.Sections[field], err = extension.CombineSections(sections...)
if err != nil {
return nil, &FormatError{
Message: fmt.Sprintf("cannot combine section %q: %v", field, err),
}
return nil, err
}
}

Expand Down Expand Up @@ -1307,9 +1305,7 @@ func ParseLayer(order int, label string, data []byte) (*Layer, error) {
// Section unmarshal rules are defined by the extension itself.
layer.Sections[field], err = extension.ParseSection(section)
if err != nil {
return nil, &FormatError{
Message: fmt.Sprintf("cannot parse layer %q section %q: %v", label, field, err),
}
return nil, err
}
}
}
Expand Down

0 comments on commit 22040e0

Please sign in to comment.