Skip to content

Commit 5e2509a

Browse files
committed
Update wrapping of key missing error
(cherry picked from commit bbb5a55)
1 parent 4d06649 commit 5e2509a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/operator/api/userconfig/validators.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func CastInputValue(value interface{}, inputSchema *InputSchema) (interface{}, e
365365
valueMapCasted[typeSchemaKey] = valueValCasted
366366
} else {
367367
if !typeSchemaValue.(*InputSchema).Optional {
368-
return nil, ErrorMustBeDefined(typeSchemaValue)
368+
return nil, errors.Wrap(ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
369369
}
370370
// don't set default (python has to)
371371
}
@@ -537,7 +537,7 @@ func CastOutputValue(value interface{}, outputSchema OutputSchema) (interface{},
537537
for typeSchemaKey, typeSchemaValue := range typeSchemaMap {
538538
valueVal, ok := valueMap[typeSchemaKey]
539539
if !ok {
540-
return nil, ErrorMustBeDefined(typeSchemaValue)
540+
return nil, errors.Wrap(ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
541541
}
542542
valueValCasted, err := CastOutputValue(valueVal, typeSchemaValue)
543543
if err != nil {

pkg/operator/context/resources.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func validateRuntimeTypes(
266266
valueMapCasted[typeSchemaKey] = valueValCasted
267267
} else {
268268
if !typeSchemaValue.(*userconfig.InputSchema).Optional {
269-
return nil, userconfig.ErrorMustBeDefined(typeSchemaValue)
269+
return nil, errors.Wrap(userconfig.ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
270270
}
271271
// don't set default (python has to)
272272
}
@@ -402,7 +402,7 @@ func validateInputRuntimeOutputTypes(outputType interface{}, schema *userconfig.
402402
}
403403
} else {
404404
if !typeSchemaValue.(*userconfig.InputSchema).Optional {
405-
return userconfig.ErrorMustBeDefined(typeSchemaValue)
405+
return errors.Wrap(userconfig.ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
406406
}
407407
}
408408
}

0 commit comments

Comments
 (0)