I had one subcontracting engagement that required this. Fortunately, the impact to my life is only two or three hundred dollars a year, billed by the same company that handles my auto and homeowner's insurance, so the price is quite reasonable, and I've renewed it even though I'm no longer working with the customer that required it.
General liability is typically bundled with other worthwhile insurance, such as theft of business property, fire damage, and a few other things. To put it into perspective, it's more likely to protect you if you got in a fistfight with a client than if you wrote a bad line of code. It protects you if you ever speak about your former clients in public (defamation, libel, etc). It protects you from certain risks involving using the client's equipment or facilities, if you are using the client's office space or if the client ever visits yours, or if you get on the elevator together and they trip over your leg and chip a tooth after bouncing off the wall. The upside is that for covered incidents, your insurance company will hire an attorney (mostly to represent their interests, but once you are insured by them, many of those interests overlap).
The caveat is this: Errors and omissions coverage, also known as "professional liability", is quite expensive; it covers the legal risk of professional mistakes, unlike general liability coverage. I negotiated my way out of a requirement for E&O and had my attorney attach a revision to the contract that reduced my professional risk exposure. Talk to your own attorney to figure out what you should do there.