Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper exception instead of an NPE upon unsafe initialization #95

Open
utybo opened this issue Sep 12, 2023 · 0 comments
Open

Add proper exception instead of an NPE upon unsafe initialization #95

utybo opened this issue Sep 12, 2023 · 0 comments

Comments

@utybo
Copy link
Owner

utybo commented Sep 12, 2023

Example of an exception occurring because of an unsafe exception in the constructor of a component:

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Map.get(Object)" because the return value of "guru.zoroark.tegral.di.environment.MixedImmutableEnvironment.access$getComponents$p(guru.zoroark.tegral.di.environment.MixedImmutableEnvironment)" is null
	at guru.zoroark.tegral.di.environment.MixedImmutableEnvironment$MIEInjector$getValue$1.invoke(MixedImmutableEnvironment.kt:66)
	at guru.zoroark.tegral.di.DynLazy.getOrInitialize(DynLazy.kt:37)
	at guru.zoroark.tegral.di.environment.MixedImmutableEnvironment$MIEInjector.getValue(MixedImmutableEnvironment.kt:65)
	at org.epilink.bot.http.HttpServerImpl.getWsCfg(HttpServer.kt:38)
	at org.epilink.bot.http.HttpServerImpl.<init>(HttpServer.kt:47)
	... 32 more

Also, docs about the safeInjection() failure is incorrect: unsafe injections never work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant