Tries to convert a number to a TerminationCode enum member.
The numeric code to convert.
The corresponding TerminationCode member, or throws InvalidTypeError if the code is not valid.
Tries to convert a number to a TerminationCode enum member.