using System;
using Robust.Shared.Reflection;
namespace Robust.Shared.IoC.Exceptions
{
///
/// An exception for when a type doesn't correctly implement an interface, but is still IoC or reflection accessible..
/// Such as missing an attribute.
///
///
///
[Virtual]
public class InvalidImplementationException : Exception
{
private readonly string message;
private readonly Type type;
private readonly Type parent;
/// The implementation incorrectly implementing something.
/// The interface incorrectly being implemented.
/// Additionally info.
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}";
}
}