Table of Contents

NotableDateValidationException Class

Definition

Namespace
Bodu.Globalization.Calendar
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
NotableDateValidationException.cs

The exception thrown when a notable-date document resource fails to load because one or more error-severity validation diagnostics were produced. This class cannot be inherited.

public sealed class NotableDateValidationException : Exception, ISerializable
Inheritance
NotableDateValidationException
Implements
Inherited Members
Extension Methods

Examples

try
{
    NotableDateResource resource = NotableDateResourceLoader.Load(documentXml);
}
catch (NotableDateValidationException ex)
{
    foreach (NotableDateValidationDiagnostic diagnostic in ex.Diagnostics)
        Console.WriteLine($"{diagnostic.Severity} {diagnostic.Code}: {diagnostic.Message}");
}

Remarks

The Diagnostics property carries the full diagnostic set - both the errors that caused the failure and any warnings gathered along the way - so a caller can report every problem at once rather than discovering them one load at a time.

Constructors

NotableDateValidationException()

Initializes a new instance of the NotableDateValidationException class.

public NotableDateValidationException()

NotableDateValidationException(string)

Initializes a new instance of the NotableDateValidationException class with a message.

public NotableDateValidationException(string message)

Parameters

message string

The message that describes the error.

NotableDateValidationException(string, IReadOnlyList<NotableDateValidationDiagnostic>)

Initializes a new instance of the NotableDateValidationException class with a message and the diagnostics that caused the failure.

public NotableDateValidationException(string message, IReadOnlyList<NotableDateValidationDiagnostic> diagnostics)

Parameters

message string

The message that describes the error.

diagnostics IReadOnlyList<NotableDateValidationDiagnostic>

The diagnostics produced while loading the notable-date document.

Exceptions

ArgumentNullException

diagnostics is null.

NotableDateValidationException(string, Exception)

Initializes a new instance of the NotableDateValidationException class with a message and inner exception.

public NotableDateValidationException(string message, Exception innerException)

Parameters

message string

The message that describes the error.

innerException Exception

The exception that is the cause of the current exception.

Properties

Diagnostics

Gets the diagnostics produced while loading the notable-date document.

public IReadOnlyList<NotableDateValidationDiagnostic> Diagnostics { get; }

Property Value

IReadOnlyList<NotableDateValidationDiagnostic>

The diagnostics; empty when none were supplied.

Applies to

ProductVersions
.NET8, 10

See Also