You are definitely not alone - I've also had discouraging moments with projects. The main thing is that you didn't give up. Sometimes it's good to take a break when you make a mistake and go back to it when you're refreshed. I also found, in my experience, that when I'm getting tired, I have to stop and take a break or I'll make mistakes.