Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line number returned in error description #22

Open
JeanMertz opened this issue Aug 8, 2019 · 0 comments
Open

Wrong line number returned in error description #22

JeanMertz opened this issue Aug 8, 2019 · 0 comments

Comments

@JeanMertz
Copy link
Contributor

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant