A general partner may withdraw from a limited partnership at any time by giving written notice to the other partners, but if the withdrawal notice violates the partnership agreement, the limited partnership may recover from the withdrawing general partner damages for breach of the partnership agreement and offset the damages against the amount otherwise distributable to the withdrawing general partner.