From 9a074eede278d38aa8f9d17c9ecb7a261f6612bc Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Sun, 7 Oct 2018 04:48:04 +0200 Subject: [PATCH] feat: use a minimal record when an error occurs --- cmd_airtable.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd_airtable.go b/cmd_airtable.go index ba6778ba7..ef0702915 100644 --- a/cmd_airtable.go +++ b/cmd_airtable.go @@ -96,8 +96,9 @@ func airtableSync(opts *airtableOptions) error { } logger().Debug("creating airtable record without slices", zap.String("URL", issue.URL)) r := issue.ToAirtableRecord() - r.Fields.Labels = []string{} - r.Fields.Assignees = []string{} + r.Fields = airtableIssue{ + URL: r.Fields.URL, + } if err := table.Create(&r); err != nil { return err } @@ -124,8 +125,9 @@ func airtableSync(opts *airtableOptions) error { record.Fields = issue.ToAirtableRecord().Fields if err := table.Update(&record); err != nil { logger().Warn("failed to update record, retrying without slices", zap.String("URL", issue.URL), zap.Error(err)) - record.Fields.Labels = []string{} - record.Fields.Assignees = []string{} + record.Fields = airtableIssue{ + URL: record.Fields.URL, + } if typedErr, ok := err.(airtable.ErrClientRequest); ok { record.Fields.Errors = typedErr.Err.Error() } else {