Skip to content

Commit 0b5e8d0

Browse files
committed
fix: handle errors in tgw endpoints
1 parent d5c4186 commit 0b5e8d0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

service/transit_gateway/attachments/service.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,11 @@ func (a *API) get(ctx context.Context, message string, address string) (*GetAtta
184184
a.logger.Printf("Waiting for tgwGetRequest %d to complete", task.ID)
185185

186186
err = a.taskWaiter.Wait(ctx, *task.ID)
187+
if err != nil {
188+
return nil, err
189+
}
187190

188-
a.logger.Printf("tgwGetRequest %d completed, possibly with error", task.ID, err)
191+
a.logger.Printf("tgwGetRequest %d completed", task.ID)
189192

190193
var getAttachmentsTask *GetAttachmentsTask
191194
err = a.client.Get(ctx,
@@ -264,8 +267,11 @@ func (a *API) listInvitations(ctx context.Context, message string, address strin
264267
a.logger.Printf("Waiting for tgwListInvitationsRequest %d to complete", task.ID)
265268

266269
err = a.taskWaiter.Wait(ctx, *task.ID)
270+
if err != nil {
271+
return nil, err
272+
}
267273

268-
a.logger.Printf("tgwListInvitationsRequest %d completed, possibly with error", task.ID, err)
274+
a.logger.Printf("tgwListInvitationsRequest %d completed", task.ID)
269275

270276
var invitationsResponse *InvitationsResponse
271277
err = a.client.Get(ctx,

0 commit comments

Comments
 (0)