ResolutionFailedException
Represents the exception the container throws when a service resolution is failed.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace Stashbox.Exceptions
{
[Serializable]
[System.Runtime.CompilerServices.NullableContext(2)]
[System.Runtime.CompilerServices.Nullable(0)]
public class ResolutionFailedException : Exception
{
public Type Type { get; }
public ResolutionFailedException(Type type, object name = null, [System.Runtime.CompilerServices.Nullable(1)] string message = "Service is not registered properly or unresolvable type requested.", Exception innerException = null)
: base("Unable to resolve type '" + type?.FullName + "'" + ((name != null) ? (" with name '" + name?.ToString() + "'") : "") + "." + Environment.NewLine + message, innerException)
{
Type = type;
}
[System.Runtime.CompilerServices.NullableContext(1)]
protected ResolutionFailedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}