test case for #1035
Fixes #1035 by catching the format error and returning the erased type as a backup.

Review by @gkossakowski.