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.
Merge pull request #4957 from cpcloud/hdfstore-append-error-fix

BUG: fix incorrect TypeError raise