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

Append a more explanatory error message for Compute Operation errors. #12333

Commits on Aug 18, 2022

  1. Append a more explanatory error message for Compute Operation errors. (

    …hashicorp#6403)
    
    * Prefer the Message field on LocalizedMessage to that of the top level Message.
    
    * Also update go.sum
    
    * Write full Operation error including ErrorInfo
    
    Do not just write the Operation error's LocalizedMessage.Message, but
    alos maintain the top level Message in the `Error() string` return value
    and also serialize the ErrorInfo that might exists in the error response
    as json to the returned error string.
    
    * Don't need to write an additional new line
    
    * Need encoding/json for ga too because of ErrorInfo
    
    Since we're serializing ErrorInfo to json and appending to a buffer for
    the ComputeOperationError message, we need encoding/json in ga too.
    
    * Do not append ErrorInfo as JSON
    
    Append LocalizedMessage.Message to Error.Message, but do not serailize
    an ErrorInfo, if one were to exist, as JSON to the io.Writer.
    
    * Need to import io for io.StringWriter
    
    Signed-off-by: Modular Magician <[email protected]>
    modular-magician committed Aug 18, 2022
    Configuration menu
    Copy the full SHA
    ec2d16c View commit details
    Browse the repository at this point in the history