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

Provide better error messages on invalid Kotlin interaction definitions #1495

Open
basdgrt opened this issue May 24, 2023 · 0 comments
Open

Comments

@basdgrt
Copy link
Contributor

basdgrt commented May 24, 2023

For example when the possible outcome events are not a sealed hierarchy the error message is really vague:

Exception in thread "main" java.lang.NullPointerException
	at com.ing.baker.recipe.kotlindsl.Event.<init>(Event.scala:17)
	at com.ing.baker.recipe.kotlindsl.KotlinDslKt.toEvent(KotlinDsl.kt:465)
	at com.ing.baker.recipe.kotlindsl.KotlinDslKt.toEvent$default(KotlinDsl.kt:464)
	at com.ing.baker.recipe.kotlindsl.InteractionBuilder.extractOutputEvents(KotlinDsl.kt:280)
	at com.ing.baker.recipe.kotlindsl.InteractionBuilder.build(KotlinDsl.kt:262)
	at nl.ing.recipe.accountholder.recipe.MainRecipeKt$main$recipe$1.invoke(MainRecipe.kt:232)
	at nl.ing.recipe.accountholder.recipe.MainRecipeKt$main$recipe$1.invoke(MainRecipe.kt:33)
	at com.ing.baker.recipe.kotlindsl.KotlinDslKt.recipe(KotlinDsl.kt:35)
	at nl.ing.recipe.accountholder.recipe.MainRecipeKt.main(MainRecipe.kt:33)
	at nl.ing.recipe.accountholder.recipe.MainRecipeKt.main(MainRecipe.kt)

We should improve on this and give some pointers on possible fixes. At least mention the interaction name which results in this problem.

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

No branches or pull requests

1 participant