Skip to content

Commit 05e83c1

Browse files
authored
Merge pull request #250 from modelix/ResolveNodeStep-error-message
fix(modelql): error message for failed node resolution didn't contain the reference
2 parents 4047849 + 33480fb commit 05e83c1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/IStepOutput.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ typealias StepFlow<E> = Flow<IStepOutput<E>>
3333
val <T> Flow<IStepOutput<T>>.value: Flow<T> get() = map { it.value }
3434
fun <T> Flow<T>.asStepFlow(owner: IProducingStep<T>?): StepFlow<T> = map { it.asStepOutput(owner) }
3535

36-
class SimpleStepOutput<out E>(override val value: E, val owner: IProducingStep<E>?) : IStepOutput<E>
36+
class SimpleStepOutput<out E>(override val value: E, val owner: IProducingStep<E>?) : IStepOutput<E> {
37+
override fun toString(): String {
38+
return "SimpleStepOutput[$value]"
39+
}
40+
}
3741

3842
class SimpleStepOutputSerializer<E>(val valueSerializer: KSerializer<E>, val owner: IProducingStep<E>?) : KSerializer<SimpleStepOutput<E>> {
3943
init {

modelql-untyped/src/commonMain/kotlin/org/modelix/modelql/untyped/ResolveNodeStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import org.modelix.modelql.core.stepOutputSerializer
3939
class ResolveNodeStep() : MonoTransformingStep<INodeReference, INode>() {
4040
override fun createFlow(input: StepFlow<INodeReference>, context: IFlowInstantiationContext): StepFlow<INode> {
4141
return input.map {
42-
it.value.resolveInCurrentContext() ?: throw IllegalArgumentException("Node not found: $it")
42+
it.value.resolveInCurrentContext() ?: throw IllegalArgumentException("Node not found: ${it.value}")
4343
}.asStepFlow(this)
4444
}
4545

0 commit comments

Comments
 (0)