How to recover from 'An error occurred' in iTunes?
I had the same problem the other day. 

I signed out from my account (go to Account -> Sign out...) and then I quit iTunes. I signed in after relaunching and everything seems to be working. It has been working fine for the last two days.