Obligatory gift contract, the gift of property is defective, the donor in the limit of the obligation attached to the same responsibility as the seller.
Cups are used for what, can not seal whether the cup seriously affect the performance of the cup. The size of that defect affects the size of its grantor's warranty liability.
If B feels that his friendship with A is worth the $30 price tag, go to A and hold him liable for the defective warranty.
If the friendship between the two is something that money can't measure, then B can use the cup as a vase.