TomlException Class
Exception thrown when parsing or serializing TOML fails.
public sealed class TomlException : Exception- Inheritance
ExceptionTomlException
Constructors
| Name | Description |
|---|---|
| TomlException() | Initializes a new instance of the TomlException class. |
| TomlException(DiagnosticsBag) | Initializes a new instance of the TomlException class. |
| TomlException(TomlSourceSpan, string) | Initializes a new instance of the TomlException class with a specific source location. |
| TomlException(TomlSourceSpan, string, Exception?) | Initializes a new instance of the TomlException class with a specific source location. |
| TomlException(string) | Initializes a new instance of the TomlException class. |
| TomlException(string, Exception) | Initializes a new instance of the TomlException class. |
TomlException overloads
TomlException()
TomlException.csInitializes a new instance of the TomlException class.
public TomlException()TomlException(DiagnosticsBag)
TomlException.csInitializes a new instance of the TomlException class.
public TomlException(DiagnosticsBag diagnostics)Parameters
diagnosticsDiagnosticsBag- The diagnostics that caused the exception.
TomlException(TomlSourceSpan, string)
TomlException.csInitializes a new instance of the TomlException class with a specific source location.
public TomlException(TomlSourceSpan span, string message)Parameters
spanTomlSourceSpanmessagestring
TomlException(TomlSourceSpan, string, Exception?)
TomlException.csInitializes a new instance of the TomlException class with a specific source location.
public TomlException(TomlSourceSpan span, string message, Exception? innerException)Parameters
spanTomlSourceSpanmessagestringinnerExceptionException?
TomlException(string)
TomlException.csInitializes a new instance of the TomlException class.
public TomlException(string message)Parameters
messagestring
TomlException(string, Exception)
TomlException.csInitializes a new instance of the TomlException class.
Properties
| Name | Description |
|---|---|
| Column | Gets the 1-based column number associated with this exception, or null when unknown. |
| Diagnostics | Gets the diagnostics associated with the exception. |
| Line | Gets the 1-based line number associated with this exception, or null when unknown. |
| Message | Gets a message that describes the current exception. |
| Offset | Gets the 0-based offset associated with this exception, or null when unknown. |
| SourceName | Gets the optional source name associated with this exception (for example, a file path). |
| Span | Gets the optional source span associated with this exception. |
Column
TomlException.csDiagnostics
TomlException.csGets the diagnostics associated with the exception.
public DiagnosticsBag Diagnostics { get; }Property value
Line
TomlException.csMessage
TomlException.csOffset
TomlException.csSourceName
TomlException.csSpan
TomlException.csGets the optional source span associated with this exception.
public TomlSourceSpan? Span { get; }