From 2a426f17a173029a8e3d7157d0c32ef5ce82f4b2 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Wed, 1 Feb 2023 21:59:08 -0500 Subject: [PATCH] Update for troubleshooting. --- src/internal/connector/exchange/attachment.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/internal/connector/exchange/attachment.go b/src/internal/connector/exchange/attachment.go index 5b6334e21..e24c592e0 100644 --- a/src/internal/connector/exchange/attachment.go +++ b/src/internal/connector/exchange/attachment.go @@ -3,11 +3,13 @@ package exchange import ( "bytes" "context" + "fmt" "io" "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/pkg/errors" + "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/connector/uploadsession" "github.com/alcionai/corso/src/pkg/logger" ) @@ -55,13 +57,18 @@ func uploadAttachment( // item Attachments to be skipped until the completion of Issue #2353 if attachmentType == models.ITEM_ATTACHMENTTYPE { - logger.Ctx(ctx).Infow("item attachment uploads are not supported ", - "attachment_name", *attachment.GetName(), // TODO: Update to support PII protection - "attachment_type", attachmentType, - "attachment_id", *attachment.GetId(), - ) + attachment, err := support.ToItemAttachment(attachment) + if err != nil { + logger.Ctx(ctx).Infow("item attachment uploads are not supported ", + "attachment_name", *attachment.GetName(), // TODO: Update to support PII protection + "attachment_type", attachmentType, + "attachment_id", *attachment.GetId(), + ) - return nil + fmt.Println("Error returned: " + err.Error()) + + return nil + } } // For Item/Reference attachments *or* file attachments < 3MB, use the attachments endpoint