Skip to content

Commit

Permalink
Update wrapping of key missing error
Browse files Browse the repository at this point in the history
(cherry picked from commit bbb5a55)
  • Loading branch information
deliahu committed Jun 14, 2019
1 parent 4d06649 commit 5e2509a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/operator/api/userconfig/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func CastInputValue(value interface{}, inputSchema *InputSchema) (interface{}, e
valueMapCasted[typeSchemaKey] = valueValCasted
} else {
if !typeSchemaValue.(*InputSchema).Optional {
return nil, ErrorMustBeDefined(typeSchemaValue)
return nil, errors.Wrap(ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
}
// don't set default (python has to)
}
Expand Down Expand Up @@ -537,7 +537,7 @@ func CastOutputValue(value interface{}, outputSchema OutputSchema) (interface{},
for typeSchemaKey, typeSchemaValue := range typeSchemaMap {
valueVal, ok := valueMap[typeSchemaKey]
if !ok {
return nil, ErrorMustBeDefined(typeSchemaValue)
return nil, errors.Wrap(ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
}
valueValCasted, err := CastOutputValue(valueVal, typeSchemaValue)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/context/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func validateRuntimeTypes(
valueMapCasted[typeSchemaKey] = valueValCasted
} else {
if !typeSchemaValue.(*userconfig.InputSchema).Optional {
return nil, userconfig.ErrorMustBeDefined(typeSchemaValue)
return nil, errors.Wrap(userconfig.ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
}
// don't set default (python has to)
}
Expand Down Expand Up @@ -402,7 +402,7 @@ func validateInputRuntimeOutputTypes(outputType interface{}, schema *userconfig.
}
} else {
if !typeSchemaValue.(*userconfig.InputSchema).Optional {
return userconfig.ErrorMustBeDefined(typeSchemaValue)
return errors.Wrap(userconfig.ErrorMustBeDefined(typeSchemaValue), s.UserStrStripped(typeSchemaKey))
}
}
}
Expand Down

0 comments on commit 5e2509a

Please sign in to comment.