This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Display diagnostic info when reporting errors #870
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expectation
This PR is a proof of concept for displaying additional diagnostic details when an error is returned. The PR is provided as a way of starting a discussion around whether this feature is useful and provides a working example that may be of use.
If this feature or the implementation is not appropriate, I'm happy to close this PR.
Why
A single version of the TF provider must support multiple versions of Octopus. Not all resources will be supported by all versions of Octopus, and when a resource that is not supported by the version of Octopus is modified, the error presented to the user is the API response.
It is reasonable to assume this error to be passed to customer facing teams like the support team, CSMs, SEs, or included in an issue in this repo.
To help the support teams, this PR wraps all calls to
diagnostics.AddError
and displays a common set of diagnostic information including:Embedding these details in all error messages aim to improve the DevEx of our customers by:
Changes
The error output now looks like this. Note the
Executable
,Terraform Version
, andOctopus Version
fields in the output.Note that
Octopus Version
isUnknown
now because of a bug in the client library.