You need to include RangeException here. FormatException doesn't apply.