Cleaned up trans_fail functions, per eddyb request.
Merge pull request #12636 from chromatic/fixup_trans_fail

Cleaned up trans_fail(), per eddyb request.

Reviewed-by: huonw