“A man can fail many times, but he isn't a failure until he begins to blame somebody else.”
John Burroughs (1837–1921) American naturalist and essayist
Variant: You can get discouraged many times, but you are not a failure until you begin to blame somebody else and stop trying.