Reqord and fix message of multiple qualifier resolve exception

This commit is contained in:
Mike Bierlee 2014-11-27 00:46:03 +01:00
parent 7b73392004
commit bc972d1371
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@ class DependencyContainer {
if (resolveType == qualifierType) { if (resolveType == qualifierType) {
if (candidates.length > 1) { if (candidates.length > 1) {
string candidateList = candidates.toConcreteTypeListString(); 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]; return candidates[0];

View file

@ -123,7 +123,7 @@ public Registration existingInstance(Registration registration, Object instance)
public string toConcreteTypeListString(Registration[] registrations) { public string toConcreteTypeListString(Registration[] registrations) {
auto concreteTypeListString = ""; auto concreteTypeListString = "";
foreach (registration ; registrations) { foreach (registration ; registrations) {
if (!concreteTypeListString.length) { if (concreteTypeListString.length > 0) {
concreteTypeListString ~= ", "; concreteTypeListString ~= ", ";
} }
concreteTypeListString ~= registration.instantiatableType.toString(); concreteTypeListString ~= registration.instantiatableType.toString();