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

Improve error message : add request ID #615

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

theredcat
Copy link
Contributor

Description

Add request ID in error message when CheckDeleted function is used. This information is systematically asked by the support but isn't available anywhere in a normal run

Type of change

  • Improvement (improve existing resource(s) or datasource(s))

How Has This Been Tested?

Just waited for one of the occasionnal API fail

d.SetId("")
return nil
}

return fmt.Errorf("calling %s:\n\t %s", endpoint, err.Error())
return fmt.Errorf("calling %s:\n\t %s Query ID : %s", endpoint, err.Error(), errOvh.QueryID)
Copy link
Contributor

Choose a reason for hiding this comment

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

you should use errOvh.QueryID only if we're sure that ok is true, something like:

var queryID string
if ok {
  queryID = errOvh.QueryID
}

Copy link

@mxpetit mxpetit left a comment

Choose a reason for hiding this comment

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

agreed with @amstuta

@theredcat
Copy link
Contributor Author

@mxpetit @amstuta I've made some changes. I've preffered to split the error message in two cases to prevent an empty Query ID : when it's not available

@amstuta
Copy link
Contributor

amstuta commented Oct 17, 2024

Thanks for your contribution @theredcat :)

@amstuta amstuta requested a review from mxpetit October 17, 2024 15:15
@amstuta amstuta dismissed mxpetit’s stale review October 17, 2024 15:15

re-checked since, is ok

@amstuta amstuta merged commit 814b83b into ovh:master Oct 17, 2024
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.

3 participants