[RFC] build: Add failure message along with number

This change is based on pull request #1544