mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace Robust.Shared.Exceptions
|
|
{
|
|
/// <summary>
|
|
/// Thrown if a method is called with an invalid type argument.
|
|
/// For example <see cref="IoC.IoCManager.Register{TInterface, TImplementation}(bool)"/> with an abstract <code>TImplementation</code>.
|
|
/// </summary>
|
|
[Serializable]
|
|
public sealed class TypeArgumentException : Exception
|
|
{
|
|
/// <summary>
|
|
/// The name of the type argument that had invalid data.
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|
|
}
|