Learning to embrace failure as data