Skip to content

Commit

Permalink
Fix is not found error for snapshots (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas authored Jan 8, 2025
2 parents de3decb + 72af861 commit 72de688
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/shared/pkg/db/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ func (db *DB) GetLastSnapshot(ctx context.Context, sandboxID string, teamID uuid

notFound := models.IsNotFound(err)

if err != nil && !notFound {
if err != nil {
return nil, nil, fmt.Errorf("failed to get snapshot build for '%s': %w", sandboxID, err)
}

if notFound {
return nil, nil, fmt.Errorf("no snapshot build found for '%s'", sandboxID)
}

return e.Edges.Snapshots[0], e.Edges.Builds[0], nil
}

0 comments on commit 72de688

Please sign in to comment.