Skip to content

MarshalStream eats error message details #3893

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

Open
grihabor opened this issue Apr 17, 2025 · 1 comment
Open

MarshalStream eats error message details #3893

grihabor opened this issue Apr 17, 2025 · 1 comment
Labels
FeatureRequest New feature or request Triage Requires triage/attention

Comments

@grihabor
Copy link

grihabor commented Apr 17, 2025

Is your feature request related to a problem? Please describe.
Here is an example:

import (
	"encoding/yaml"
)

config: {
	a: int
	b: string
	c: 42
}

output: yaml.MarshalStream([config])

Now if I run

cue export --expression output ./main.cue 

it says

output: error in call to encoding/yaml.MarshalStream: incomplete value _:
    ./main.cue:11:9

which doesn't tell me anything about which fields are incomplete.

Meanwhile, if I run

cue export --expression config ./main.cue

it shows exactly what's wrong

config.a: incomplete value int:
    ./main.cue:6:5
config.b: incomplete value string:
    ./main.cue:7:5

Describe the solution you'd like
In my example, I want the output for the command

cue export --expression output ./main.cue

be something like

output.0.config.a: incomplete value int:
    ./main.cue:6:5
output.0.config.b: incomplete value string:
    ./main.cue:7:5
@grihabor grihabor added FeatureRequest New feature or request Triage Requires triage/attention labels Apr 17, 2025
@mxey
Copy link
Contributor

mxey commented Apr 22, 2025

I think this is a duplicate of #2718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

2 participants