forked from ch-robinson/dotnet-avro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnsupportedSchemaException.cs
37 lines (35 loc) · 1.16 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
36
37
using Chr.Avro.Abstract;
using System;
namespace Chr.Avro
{
/// <summary>
/// The exception that is thrown when an operation does not support a .NET type.
/// </summary>
[Serializable]
public class UnsupportedSchemaException : Exception
{
/// <summary>
/// The schema that caused the exception to be thrown.
/// </summary>
public Schema UnsupportedSchema { get; private set; }
/// <summary>
/// Creates an exception describing the error.
/// </summary>
/// <param name="schema">
/// The schema that caused the exception to be thrown.
/// </param>
/// <param name="message">
/// A message describing the exception.
/// </param>
/// <param name="inner">
/// An underlying error that may provide additional context.
/// </param>
public UnsupportedSchemaException(Schema schema, string message = null, Exception inner = null) : base(
string.IsNullOrEmpty(message) ? $"{schema.GetType()} is not supported." : message,
inner
)
{
UnsupportedSchema = schema;
}
}
}