Ensure that exception prints correct text.

Fixes bug 1095333

Change-Id: I5077108de8dacaab4bcf0d7236123f960676d591
Merge "Ensure that exception prints correct text."