InvalidCastException

It is thrown when a factory detects that fetched object from DI container cannot be casted to required interface/class that should be passed to newly constructed object.

Constructors

this
this(string msg, string identity, TypeInfo expected, TypeInfo actual, string file, size_t line, Throwable next)
this(string msg, string identity, TypeInfo expected, TypeInfo actual, Throwable next, string file, size_t line)

Creates a new instance of Exception. The nextInChain parameter is used internally and should always be null when passed by user code. This constructor does not automatically throw the newly-created Exception; the throw statement should be used for that purpose.

Members

Functions

pushMessage
void pushMessage(void delegate(in char[]) sink)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

actual
TypeInfo actual;

Actual type of casted component

expected
TypeInfo expected;

Expected casting type.

Inherited Members

From AediException

identity
string identity;

Identity of offending component.

__anonymous
mixin AdvancedExceptionPrinting
Undocumented in source.
pushMessage
void pushMessage(void delegate(in char[]) sink)

A special function used to print customized message using built-in properties, with as less as possible allocations.

toString
alias toString = typeof(super).toString
Undocumented in source.

Meta