Convert the type code to a string.  Throw for unknown codes since we may not parse others correctly.