In reply to The Ex-Engineer:
Good answer!
It also depends on the type of climbing. If it's a redpoint or headpoint, it's all about the eventual tick. Not quite getting it after putting in a lot of effort is frustrating but I see it as part of the journey. Besides, the harder the battle, the sweeter the victory.
If it's trad, it's all about the onsight, especially if it's a grade I should be able to onsight. Having a rest or taking a fall on something I'd expect to onsight is indeed a failure (assuming it's not due to conditions or a hold braking) but that's rare. Sometimes I try onsighting routes which are at my limit and which I might not get up onsight. In that case, simply getting up them with as few rests/falls as possible is already an achievement.
If it's a winter route, falling off is a very bad idea in the first place! Anyway, I don't really push myself hard enough in winter (yet) to result in falls or rests.
If it's an alpine route, it generally won't be hard enough to involve rests or falls. Even if there was a particularly hard crux pitch where I have a rest or a fall, that wouldn't really mean I've failed as long I manage the rest of the route because for me alpine routes are more about the overall experience. However I might not be able to do the route for other reasons - route finding, conditions, weather, unacceptable objective risks and so on. Such things are frustrating but I just put them down to experience and perhaps try the route again some other time.