forked from ch-robinson/dotnet-avro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnsupportedSchemaException.cs
35 lines (33 loc) · 1.25 KB
/
UnsupportedSchemaException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
namespace Chr.Avro
{
using System;
using Chr.Avro.Abstract;
/// <summary>
/// An exception thrown when an operation does not support a schema.
/// </summary>
[Serializable]
public class UnsupportedSchemaException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="UnsupportedSchemaException" /> class.
/// </summary>
/// <param name="schema">
/// The <see cref="Schema" /> that caused the exception to be thrown.
/// </param>
/// <param name="message">
/// A message describing the exception.
/// </param>
/// <param name="inner">
/// An underlying exception that may provide additional context.
/// </param>
public UnsupportedSchemaException(Schema schema, string? message = null, Exception? inner = null)
: base(message ?? $"Failed to operate on {schema.GetType().FullName}.", inner)
{
UnsupportedSchema = schema ?? throw new ArgumentNullException(nameof(schema), "Schema cannot be null.");
}
/// <summary>
/// Gets the <see cref="Schema" /> that caused the exception to be thrown.
/// </summary>
public Schema UnsupportedSchema { get; }
}
}