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

refactor: wrapped errors #16

Open
lander2k2 opened this issue Jun 8, 2022 · 1 comment
Open

refactor: wrapped errors #16

lander2k2 opened this issue Jun 8, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@lander2k2
Copy link
Contributor

Define a consistent format for wrapping errors and defining errors.

Some thoughts on how to do this:

Option 1:

return nil, fmt.Errorf("%w; unable to convert resources object to string array", err)
unable to convert workload config spec.resources to []map[string]interface; [map[filename:/path/to/my/child-resources.yaml]]; unable to convert resources object to string array; unable to mutate configuration fields; error adding flags to `init-config collection` subcommand

Option 2:

return nil, fmt.Errorf("%w - unable to convert resources object to string array", err)
unable to convert workload config spec.resources to []map[string]interface - [map[filename:/path/to/my/child-resources.yaml]] - unable to convert resources object to string array - unable to mutate configuration fields; error adding flags to `init-config collection` subcommand

Option 3:

return nil, fmt.Errorf("%w, unable to convert resources object to string array", err)
unable to convert workload config spec.resources to []map[string]interface, [map[filename:/path/to/my/child-resources.yaml]], unable to convert resources object to string array, unable to mutate configuration fields; error adding flags to `init-config collection` subcommand

These obviously aren't the only options but are some of the patterns that I have found.

@lander2k2
Copy link
Contributor Author

Original issue:
vmware-archive/operator-builder#240

@lander2k2 lander2k2 added the good first issue Good for newcomers label Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant