From 628d2f3deca02298b661d1eedcd744a1f193855a Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Wed, 22 Feb 2023 06:46:00 -0800 Subject: [PATCH] Extract Graph API error details for permissions (#2584) ## Description Add extra information about errors to aid in debugging/reporting to the user ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup ## Issue(s) * closes #2581 ## Test Plan - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/connector/onedrive/item.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/internal/connector/onedrive/item.go b/src/internal/connector/onedrive/item.go index c962e167d..80906bc92 100644 --- a/src/internal/connector/onedrive/item.go +++ b/src/internal/connector/onedrive/item.go @@ -224,6 +224,10 @@ func oneDriveItemPermissionInfo( Permissions(). Get(ctx, nil) if err != nil { + msg := support.ConnectorStackErrorTrace(err) + err = clues.Wrap(err, "fetching item permissions: "+msg). + With("item_id", *di.GetId()) + return nil, err }