-
Notifications
You must be signed in to change notification settings - Fork 94
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
function: Replace usage of diagnostics with function errors during execution of provider-defined functions #925
Merged
Merged
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
03600f8
Replacing function.RunResponse diagnostics with error
bendbennett 4eff01d
Adding custom FunctionError
bendbennett ad94609
Adding custom FunctionErrors
bendbennett 6df74dc
Removing unneeded equateErrors gocmp option
bendbennett f32bdb1
Switching to using convenience functions for adding errors to Functio…
bendbennett 06bd2e2
Add copyright headers
bendbennett 3bf7f79
Refactor to use Error() method on function errors when converting to …
bendbennett 8957a63
Adding documentation and testing for fwerrors types
bendbennett c14bf43
Formatting errors during conversion to tfprotov<5|6>.FunctionError
bendbennett b608411
Removing argument error and argument warning diagnostics
bendbennett e3ab1d2
Renaming field name for FunctionErrors from Error to Errors
bendbennett 7f0c6ee
Modifying documentation to reflect that executing the Run() method of…
bendbennett f82289c
Remove references to AddArgumentError and AddArgumentWarning from dia…
bendbennett a488bb8
Removing fwerror package and moving FunctionError to function package
bendbennett f0d758b
Refactoring to replace FunctionErrors slice with single FunctionError
bendbennett 1419cd2
Bumping terraform-plugin-go to v0.22.0
bendbennett 9bb896b
Removing unneeded DiagnosticWithFunctionArgument interface and implem…
bendbennett 419f3e1
Merge remote-tracking branch 'origin/main' into pdf-err-handling
bendbennett cb45ef3
Altering function signature of ConcatFuncErrors
bendbennett 18c5015
Removing HasError method
bendbennett aa853c3
Updating docs
bendbennett 605ae15
Updates following code review
bendbennett 9ea959e
Adding changelog entries
bendbennett 9fb8b29
Fix naming
bendbennett 5ace625
Update website/docs/plugin/framework/functions/errors.mdx
bendbennett bba24ad
Formatting
bendbennett c705415
Updates following code review
bendbennett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: Do we think it'd be valuable to note in the
diag
package doc that this package does not contain function specific error handling? Currently it's kind of generic about the error handling it can do:terraform-plugin-framework/diag/doc.go
Lines 4 to 8 in 3c7a391
Maybe we could redirect them to the function package / specific error struct (since this is the only exception currently)
Same question for the package doc for
function
, should we note that it also contains error handling specific to function implementations:terraform-plugin-framework/function/doc.go
Lines 4 to 18 in 3c7a391
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a note into
doc.go
for bothdiag
andfunction
packages highlighting the need to useFuncError
to notify practitioners of issues arising during execution of provider-defined functions.