Skip to content

Commit

Permalink
Fix is not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Dec 20, 2024
1 parent b4f8c61 commit 6ea98ae
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 6ea98ae

Please sign in to comment.