You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return"A circular dependency was detected while resolving type '\(type)' with name '\(name)'."
55
+
}else{
56
+
return"A circular dependency was detected."
57
+
}
49
58
case.underlyingError(let error):
50
59
return"An error occurred within the factory closure: \(error.localizedDescription)"
60
+
case.invalidInstance:
61
+
return"The resolved instance is invalid or of an unexpected type."
51
62
}
52
63
}
53
64
@@ -62,6 +73,8 @@ public enum AstrojectError: LocalizedError {
62
73
return"Review your dependency graph to eliminate circular dependencies."
63
74
case.underlyingError:
64
75
return"Inspect the underlying error for more details."
76
+
case.invalidInstance:
77
+
return"The resolved instance did not match the expected type or was invalid."
65
78
}
66
79
}
67
80
@@ -77,6 +90,8 @@ public enum AstrojectError: LocalizedError {
77
90
return"Break the circular dependency by introducing an abstraction or using a different dependency injection pattern or by using `postInitAction` to initialize cyclical dependencies."
78
91
case.underlyingError:
79
92
return"Check the factory closure for errors and ensure that it's correctly implemented."
93
+
case.invalidInstance:
94
+
return"Ensure that the Instance implementation is correct and that the registered type matches the actual type of the resolved instance."
0 commit comments