BUG: fix incorrect TypeError raise

TypeError was being raised when a ValueError was raised because the 
ValueError's message wasn't being converted to a string.

closes #4956