InvalidRegistrationException
Represents an exception the container throws when it detects an invalid registration.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace Stashbox.Exceptions
{
[Serializable]
[NullableContext(2)]
[Nullable(0)]
public class InvalidRegistrationException : Exception
{
public Type Type { get; }
public InvalidRegistrationException(Type type, [Nullable(1)] string message, Exception innerException = null)
: base("Invalid registration with type '" + type?.FullName + "'. Details: " + message, innerException)
{
Type = type;
}
[NullableContext(1)]
[Obsolete(DiagnosticId = "SYSLIB0051")]
protected InvalidRegistrationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}