stage: make the unmarshalling error more verbose
Prior this commit there was no information in the log about the unrecognized stage. This commit adds the stage name to the unmarshalling error.
This commit is contained in:
parent
7a3c82a405
commit
54e27e607c
1 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ package osbuild
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// A Stage transforms a filesystem tree.
|
||||
|
|
@ -67,7 +67,7 @@ func (stage *Stage) UnmarshalJSON(data []byte) error {
|
|||
case "org.osbuild.script":
|
||||
options = new(ScriptStageOptions)
|
||||
default:
|
||||
return errors.New("unexpected stage name")
|
||||
return fmt.Errorf("unexpected stage name: %s", rawStage.Name)
|
||||
}
|
||||
err = json.Unmarshal(rawStage.Options, options)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue