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
{{ message }}
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
every time I cause a TypeError in the init method of an injected class, pinject raises a pretty cryptic Exception that makes debugging way harder:
import pinject
class Foo(object):
def init(self, bar):
self.bar = bar
class Bar(object):
def init(self, foo_bar):
self.foo_bar = foo_bar
class FooBar(object):
def init(self):
raise TypeError("test")
o = pinject.new_object_graph()
o.provide(Foo)
Traceback (most recent call last):
File "/tmp/a.py", line 16, in
o.provide(Foo)
File "/spare/local/secmaster-overwatch-infra/lib/python2.7/site-packages/pinject/object_graph.py", line 244, in provide
raise e
pinject.errors.OnlyInstantiableViaProviderFunctionError: when injecting Bar.init at /tmp/a.py:8, the arg named "foo_bar" unannotated cannot be injected, because its provider, the class main.FooBar at /tmp/a.py:11, needs at least one directly passed arg
Thanks
Mirko
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
every time I cause a TypeError in the init method of an injected class, pinject raises a pretty cryptic Exception that makes debugging way harder:
import pinject
class Foo(object):
def init(self, bar):
self.bar = bar
class Bar(object):
def init(self, foo_bar):
self.foo_bar = foo_bar
class FooBar(object):
def init(self):
raise TypeError("test")
o = pinject.new_object_graph()
o.provide(Foo)
Traceback (most recent call last):
File "/tmp/a.py", line 16, in
o.provide(Foo)
File "/spare/local/secmaster-overwatch-infra/lib/python2.7/site-packages/pinject/object_graph.py", line 244, in provide
raise e
pinject.errors.OnlyInstantiableViaProviderFunctionError: when injecting Bar.init at /tmp/a.py:8, the arg named "foo_bar" unannotated cannot be injected, because its provider, the class main.FooBar at /tmp/a.py:11, needs at least one directly passed arg
Thanks
Mirko
The text was updated successfully, but these errors were encountered: