mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 07:12:27 +02:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System;
|
|
using Robust.Shared.Reflection;
|
|
|
|
namespace Robust.Shared.IoC.Exceptions
|
|
{
|
|
/// <summary>
|
|
/// An exception for when a type doesn't correctly implement an interface, but is still IoC or reflection accessible..
|
|
/// Such as missing an attribute.
|
|
/// </summary>
|
|
/// <seealso cref="IoCManager" />
|
|
/// <seealso cref="IReflectionManager" />
|
|
[Virtual]
|
|
public class InvalidImplementationException : Exception
|
|
{
|
|
private readonly string message;
|
|
private readonly Type type;
|
|
private readonly Type parent;
|
|
|
|
/// <param name="type">The implementation incorrectly implementing something.</param>
|
|
/// <param name="parent">The interface incorrectly being implemented.</param>
|
|
/// <param name="message">Additionally info.</param>
|
|
public InvalidImplementationException(Type type, Type parent, string message)
|
|
{
|
|
this.type = type;
|
|
this.parent = parent;
|
|
this.message = message;
|
|
}
|
|
|
|
public override string Message => $"{type} incorrectly implements {parent}: {message}";
|
|
}
|
|
}
|