Unverified Commit 3e559632 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #60919 from dixudx/file_visit_error_info

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. include file name in the error when visiting files **What this PR does / why we need it**: /kind bug /sig cli **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #60916 **Special notes for your reviewer**: /cc @kubernetes/sig-cli-api-reviews **Release note**: ```release-note include file name in the error when visiting files ```
parents 7fa3c9fa a08cb5b5
# Please edit the 'last-applied-configuration' annotations below.
# Lines beginning with a '#' will be ignored, and an empty file will abort the edit.
#
# The edited file had a syntax error: error converting YAML to JSON: yaml: line 12: could not find expected ':'
# The edited file had a syntax error: error parsing edited-file: error converting YAML to JSON: yaml: line 12: could not find expected ':'
#
kind: Service
metadata:
......
......@@ -2,7 +2,7 @@
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
# The edited file had a syntax error: error converting YAML to JSON: yaml: line 17: could not find expected ':'
# The edited file had a syntax error: error parsing edited-file: error converting YAML to JSON: yaml: line 17: could not find expected ':'
#
apiVersion: v1
kind: Service
......
......@@ -578,7 +578,7 @@ func (v *StreamVisitor) Visit(fn VisitorFunc) error {
if err == io.EOF {
return nil
}
return err
return fmt.Errorf("error parsing %s: %v", v.Source, err)
}
// TODO: This needs to be able to handle object in other encodings and schemas.
ext.Raw = bytes.TrimSpace(ext.Raw)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment