Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions errors/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ var (
ErrExpectedInt = fmt.Errorf(
"%w: expected int value", ErrParse,
)
// ErrExpectedScalarOrMap indicates that we did not find an expected
// scalar or map field
ErrExpectedScalarOrMap = fmt.Errorf(
"%w: expected scalar or map field", ErrParse,
)
// ErrExpectedScalarOrSequence indicates that we did not find an expected
// scalar or sequence of scalars field
ErrExpectedScalarOrSequence = fmt.Errorf(
Expand Down Expand Up @@ -126,6 +131,15 @@ func ExpectedScalarOrSequenceAt(node *yaml.Node) error {
)
}

// ExpectedScalarOrMapAt returns an ErrExpectedScalarOrMap error annotated with
// the line/column of the supplied YAML node.
func ExpectedScalarOrMapAt(node *yaml.Node) error {
return fmt.Errorf(
"%w at line %d, column %d",
ErrExpectedScalarOrMap, node.Line, node.Column,
)
}

// ExpectedTimeoutAt returns an ErrExpectedTimeout error annotated
// with the line/column of the supplied YAML node.
func ExpectedTimeoutAt(node *yaml.Node) error {
Expand Down