|
|
|
@ -573,8 +573,7 @@ func templatingError(err error) error {
|
|
|
|
|
if errors.As(err, &syntaxError) {
|
|
|
|
|
// offset is arguably not super clear to the user, but it's the best we can do here
|
|
|
|
|
cause = fmt.Errorf("%s at offset %d", cause.Error(), syntaxError.Offset)
|
|
|
|
|
}
|
|
|
|
|
if errors.As(err, &typeError) {
|
|
|
|
|
} else if errors.As(err, &typeError) {
|
|
|
|
|
// slightly rewriting the default error message to include the offset
|
|
|
|
|
cause = fmt.Errorf("cannot unmarshal %s at offset %d into Go value of type %s", typeError.Value, typeError.Offset, typeError.Type)
|
|
|
|
|
}
|
|
|
|
|