Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetException()

static Exception System.Number.GetException ( ParsingStatus status,
TypeCode type )
inlinestaticprivate

Definition at line 5929 of file Number.cs.

5930 {
5931 if (status == ParsingStatus.Failed)
5932 {
5933 return new FormatException(SR.Format_InvalidString);
5934 }
5935 return new OverflowException(type switch
5936 {
5937 TypeCode.SByte => SR.Overflow_SByte,
5938 TypeCode.Byte => SR.Overflow_Byte,
5939 TypeCode.Int16 => SR.Overflow_Int16,
5940 TypeCode.UInt16 => SR.Overflow_UInt16,
5941 TypeCode.Int32 => SR.Overflow_Int32,
5942 TypeCode.UInt32 => SR.Overflow_UInt32,
5943 TypeCode.Int64 => SR.Overflow_Int64,
5944 TypeCode.UInt64 => SR.Overflow_UInt64,
5945 _ => SR.Overflow_Decimal,
5946 });
5947 }

References System.SR.Format_InvalidString, System.SR.Overflow_Byte, System.SR.Overflow_Decimal, System.SR.Overflow_Int16, System.SR.Overflow_Int32, System.SR.Overflow_Int64, System.SR.Overflow_SByte, System.SR.Overflow_UInt16, System.SR.Overflow_UInt32, System.SR.Overflow_UInt64, and System.type.

Referenced by System.Number.ThrowOverflowException(), and System.Number.ThrowOverflowOrFormatException().