-
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
Add marshal and unmarshal methods for Error. #25
Conversation
For anyone looking at this one, I made a comment in that other earlier pull request that you might be interested in. |
You make an excellent point there, @mentalisttraceur. I have reworked my code to do this, since it seems like a much better solution. Unfortunately, after the long holiday torpor, I did some bad git stuff, so I accidentally integrated other changes into this pr. I'm about to fix that up. |
Okay, this has been fixed up now. This implementation now differs slightly from #15 base on this comment. I think this is improved. Hope to hear from you @mentalisttraceur, and maybe @mitchellh or a maintainer could get one of these merged. |
Is there any chance this (or anything like it) could be merged? I'm hoping to use this in a Nomad API wrapper to send clients more complex errors. |
I haven't followed up on this in quite some time, so it looks like there are conflicts now. I'll resolve those soon, though I doubt that will cause it to be merged. I don't know why this has sat so long, but at least that way you could operate from the updated fork with the patch. |
This is based off hashicorp#15, which was never merged due to cla.
This is now up-to-date again, and should be ready for merge. |
Heh somehow still seems there is a file conflict? :( |
Why do you say that? Conflicts are resolved and checks are passing? |
Passing by after encountering the same issue with marshalling multierror. Is there an estimate for the merge of this PR? |
Apologies for all the delays with this one. I am happy to shepherd it along in whatever way possible. That said, I do have reservations about adding JSON marshal/unmarshal implementations to the library. For one, serializing it as a slice conflicts with the native Also, There’s also the issue of custom marshal/unmarshal functionality being difficult to maintain as a library. For example, what happens if today we decide to marshal as an array, but we later decide that, because And then there’s the fact that if you really want to marshal the value as a slice, then you can use
I’m open to discussing it, but for all these reasons, I think we should hold off on adding this functionality and leave it up to the calling code to decide how these values get marshaled and unmarshaled. |
@eculver All good points. Too much time has passed for me to still possess strong feelings or need for this feature. If I had a better memory, maybe I could recall my justification better. In any case, if the discussion continues and requires changes, I will happily make them. |
Sounds good, I'll go ahead and close this but feel free to re-open if you feel I'm wrong. Thanks for the discussion :) |
This is based off #15, which was never merged due to cla.