There's a nice quote I came across the other day which sums up a good outlook or view to mistakes. Considering them as more of a lesson and learning process, i.e. as a means rather than an end in itself. I hope you enjoy it :)
“There are no mistakes. The events we bring upon ourselves, no matter how unpleasant, are necessary in order to learn what we need to learn; whatever steps we take, they're necessary to reach the places we've chosen to go.” - Richard Bach, American writer
Here's also another quote for you
"The real reason for failure is unwillingness, the pretended reason, inability" - Seneca