Skip to content

Conversation

rubys
Copy link
Contributor

@rubys rubys commented Aug 28, 2025

return nil, fmt.Errorf("failed to parse compose file: %w", err)
// Try to extract more detailed error information from yaml.TypeError
if typeErr, ok := err.(*yaml.TypeError); ok && len(typeErr.Errors) > 0 {
return nil, fmt.Errorf("YAML syntax error in compose file %s: %s", composePath, typeErr.Errors[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it have multiple errors in Errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, I'm fine with returning only the first error. Do you see this as a problem?

Copy link
Member

@kzys kzys Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the parser can detect multiple errors, it makes sense to show all of them instead of hiding.

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

Successfully merging this pull request may close these issues.

2 participants