This function doesn't seem to do anything useful- I would just replace `ctx.newErrorObjectOrValue(err)` with `ctx.NewError(err.Error())`.