-
Notifications
You must be signed in to change notification settings - Fork 128
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
Allow marshalling a multi-error #15
base: main
Are you sure you want to change the base?
Conversation
Without this change any objects containing a multierror will fail to Marshal, though most objects that implement the Error() interface are safe (albeit not useful) to convert to JSON. This pull request goes one step further and tries to make the JSON output somewhat useful, and defines a way to reconstruct a multierror that looks superficially similar to the original when Unmarshalled again.
I don't think he is going to complete that cla, so I'm going to rework this so we can get it in. |
This is based off hashicorp#15, which was never merged due to cla.
This can be closed if #25 is merged. |
fixed — sorry for missing that! Also happy for your version to be merged instead |
Ah, no sweat. I didn't think you'd jump on it so quickly after two years, else I wouldn't have done that. Yeah, I hope you get merged up. |
Suggestion: marshal to just the inner list, instead of wrapping it in an (Disclaimer: I'm not affiliated with Hashicorp in any way, I'm just a rando on the internet with Ideas(TM) and the hubris to think they're worth saying.) Consider the difference between:
Basically:
|
This is based off hashicorp#15, which was never merged due to cla.
This is based off hashicorp#15, which was never merged due to cla.
This is based off hashicorp#15, which was never merged due to cla.
Without this change any objects containing a multierror will fail to
Marshal, though most objects that implement the Error() interface
are safe (albeit not useful) to convert to JSON.
This pull request goes one step further and tries to make the JSON
output somewhat useful, and defines a way to reconstruct a
multierror that looks superficially similar to the original when
Unmarshalled again.