My PSN card when I put in my code it says error has occurred .
Welcome to the PlayStation Community.
Make sure you're entering the code correctly, for example it's very easy to mistake '0' for 'O', I've done it myself!
Also I assume the card is in the same denomination as your PSN Account?
I'm not sure it matters too much but the PS Store is/was being updated this afternoon/evening.
Lastly there is a chance that the card was not activated curing the checkout process, where did you purchase your card from?
Customer Service - 1-800-345-SONY (7669)
Available Mon to Fri From 8am - 8pm PST