Skip to content

Provide better error messages on invalid Kotlin interaction definitions #1495

@basdgrt

Description

@basdgrt

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions