Skip to content

Commit

Permalink
Check lpa returned is empty as error not returned by DynamoDB VEGA-22…
Browse files Browse the repository at this point in the history
…03 #minor
  • Loading branch information
Iqpal Mannan committed Dec 15, 2023
1 parent 8fbe7e8 commit e6f31f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lambda/get/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ func (l *Lambda) HandleEvent(ctx context.Context, event events.APIGatewayProxyRe

lpa, err := l.store.Get(ctx, event.PathParameters["uid"])

Check failure on line 37 in lambda/get/main.go

View workflow job for this annotation

GitHub Actions / Run static analysis checks

ineffectual assignment to err (ineffassign)

if err != nil {
l.logger.Print(err)
// If item can't be found in DynamoDB then it returns empty object hence 404 error returned if
// empty object returned
if lpa.Uid == "" {
l.logger.Print("Uid not found")
return shared.ProblemNotFoundRequest.Respond()
}

Expand Down

0 comments on commit e6f31f3

Please sign in to comment.