NotableDateValidationException Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
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
messagestringThe 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
messagestringThe message that describes the error.
diagnosticsIReadOnlyList<NotableDateValidationDiagnostic>The diagnostics produced while loading the notable-date document.
Exceptions
- ArgumentNullException
diagnosticsis 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
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
| Product | Versions |
|---|---|
| .NET | 8, 10 |