I only consider it a failure if my death causes a wipe. Sure it sucks to die right at the end, but things happen and we all mess up at times.

If it's a constant issue, though, I'd recommend making some alterations to your play style.