Logging and error handling improvements, bug fixes (#21)
- Uniformed logs and diagnostics: - Logging and adding to diagnostics is done by the highest level function (Create/Read/Update/Delete/Import) using `LogAndAddError` - Lower-level routines' signature changed to return error instead of writing to diagnostics - Standardize summary and details across services - Removed manual adding of relevant variables to details (they're in the context, TF adds them to logs) - Changed validators to be closer to official implementation - Fix logging wrong output after wait - Fix Argus checking wrong diagnostics - Fix Resource Manager not updating state after project update - Fix unnecessary pointer in LogAndAddError
This commit is contained in:
parent
29b8c91999
commit
4e8514df00
51 changed files with 1389 additions and 1092 deletions
|
|
@ -52,5 +52,5 @@ func DiagsToError(diags diag.Diagnostics) error {
|
|||
// LogAndAddError Logs the error and adds it to the diags
|
||||
func LogAndAddError(ctx context.Context, diags *diag.Diagnostics, summary, detail string) {
|
||||
tflog.Error(ctx, summary)
|
||||
(*diags).AddError(summary, detail)
|
||||
diags.AddError(summary, detail)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue