using System;
using System.Runtime.Serialization;
namespace Robust.Shared.Exceptions
{
///
/// Thrown if a method is called with an invalid type argument.
/// For example with an abstract TImplementation.
///
[Serializable]
public sealed class TypeArgumentException : Exception
{
///
/// The name of the type argument that had invalid data.
///
public readonly string? TypeArgumentName;
public TypeArgumentException()
{
}
public TypeArgumentException(string message) : base(message)
{
}
public TypeArgumentException(string message, Exception inner) : base(message, inner)
{
}
public TypeArgumentException(string message, string name) : base(message)
{
TypeArgumentName = name;
}
public TypeArgumentException(string message, string name, Exception inner) : base(message, inner)
{
TypeArgumentName = name;
}
}
}