diff --git a/data-cursor.go b/data-cursor.go index 7056eaf..4f6814d 100644 --- a/data-cursor.go +++ b/data-cursor.go @@ -5,6 +5,7 @@ package expr import ( + "errors" "io" ) @@ -46,15 +47,19 @@ func (dc *dataCursor) Reset() (err error) { dc.index = -1 } exportObjects(dc.ctx, ctx) + } else { + err = errors.New("no 'reset' function defined in the data-source") } return } func (dc *dataCursor) Clean() (err error) { - if dc.resetFunc != nil { + if dc.cleanFunc != nil { ctx := cloneContext(dc.ctx) _, err = dc.cleanFunc.Invoke(ctx, cleanName, []any{}) exportObjects(dc.ctx, ctx) + } else { + err = errors.New("no 'clean' function defined in the data-source") } return }