Skip to content

Wrong line number returned in error description #22

@JeanMertz

Description

@JeanMertz

See #21.

I suspect this is happening here:

func errorLine(err error) (int, string) {
var i int
var p []string
str := err.Error()
println(str)
if strings.HasPrefix(str, "yaml: ") {
p = strings.SplitN(str, ":", 3)
i, _ = strconv.Atoi(strings.Replace(p[1], " line ", "", -1))
str = strings.TrimSpace(p[2])
}
if strings.HasPrefix(str, "template: test:") {
p = strings.SplitN(str, ":", 4)
i, _ = strconv.Atoi(p[2])
str = strings.TrimSpace(p[3])
}
return i, "Templating error: " + str
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions