Noda Time
Show / Hide Table of Contents

Class UnparsableValueException

Exception thrown to indicate that the specified value could not be parsed.
Since 1.0.x
Availability net6.0, net8.0, netstandard2.0
Inheritance
object
Exception
SystemException
FormatException
UnparsableValueException
Implements
ISerializable
Inherited Members
Exception.GetBaseException()
Exception.GetType()
Exception.ToString()
Exception.Data
Exception.HelpLink
Exception.HResult
Exception.InnerException
Exception.Message
Exception.Source
Exception.StackTrace
Exception.TargetSite
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.ReferenceEquals(object, object)
Namespace: NodaTime.Text
Assembly: NodaTime.dll
Syntax
public sealed class UnparsableValueException : FormatException, ISerializable

Constructors

UnparsableValueException()

Creates a new UnparsableValueException with no message, value or index. Value will be an empty string, and Index will have a value of -1.
Since 1.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
[Obsolete("Use constructors accepting a value")]
public UnparsableValueException()

UnparsableValueException(string)

Creates a new UnparsableValueException with the given message, but no value or index. Value will be an empty string, and Index will have a value of -1.
Since 1.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
[Obsolete("Use constructors accepting a value")]
public UnparsableValueException(string message)
Parameters
Type Name Description
string message The failure message

UnparsableValueException(string, Exception)

Creates a new UnparsableValueException with the given message and base exception, but no value or index. Value will be an empty string, and Index will have a value of -1.
Since 3.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
[Obsolete("Use constructors accepting a value")]
public UnparsableValueException(string message, Exception innerException)
Parameters
Type Name Description
string message The failure message
Exception innerException The inner exception

UnparsableValueException(string, string, int)

Creates a new UnparsableValueException with the given message, value and index at which parsing failed.
Since 3.2.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public UnparsableValueException(string message, string value, int index)
Parameters
Type Name Description
string message The failure message
string value The value which could not be parsed
int index The index within the value where parsing failed

UnparsableValueException(string, string, int, Exception)

Creates a new UnparsableValueException with the given message, value, index and inner exception.
Since 3.2.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public UnparsableValueException(string message, string value, int index, Exception innerException)
Parameters
Type Name Description
string message The failure message
string value The value which could not be parsed
int index The index within the value where parsing failed
Exception innerException The inner exception

Properties

Index

The index within the value where parsing failed. This will be -1 if parsing failed before examining any text, for example because parsing was requested on a format-only pattern, or the value to be parsed was empty.
Since 3.2.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public int Index { get; }
Property Value
Type Description
int

Value

The value which could not be parsed.
Since 3.2.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public string Value { get; }
Property Value
Type Description
string

Implements

ISerializable
In this article
Back to top Generated by DocFX