mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Reqord and fix message of multiple qualifier resolve exception
This commit is contained in:
parent
7b73392004
commit
bc972d1371
|
@ -111,7 +111,7 @@ class DependencyContainer {
|
|||
if (resolveType == qualifierType) {
|
||||
if (candidates.length > 1) {
|
||||
string candidateList = candidates.toConcreteTypeListString();
|
||||
throw new ResolveException("Multiple qualified candidates available: " ~ candidateList ~ ". Please specify qualifier.", resolveType);
|
||||
throw new ResolveException("Multiple qualified candidates available: " ~ candidateList ~ ". Please use a qualifier.", resolveType);
|
||||
}
|
||||
|
||||
return candidates[0];
|
||||
|
|
|
@ -123,7 +123,7 @@ public Registration existingInstance(Registration registration, Object instance)
|
|||
public string toConcreteTypeListString(Registration[] registrations) {
|
||||
auto concreteTypeListString = "";
|
||||
foreach (registration ; registrations) {
|
||||
if (!concreteTypeListString.length) {
|
||||
if (concreteTypeListString.length > 0) {
|
||||
concreteTypeListString ~= ", ";
|
||||
}
|
||||
concreteTypeListString ~= registration.instantiatableType.toString();
|
||||
|
|
Loading…
Reference in a new issue