diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -53,6 +53,7 @@ def newEnvelopeCurve(graph, ctx, uri, la @inlineCallbacks def insertEnvelopePoints(curve): + # wrong: we might not be adding to the currently-playing song. musicStatus = yield getMusicStatus() songTime=musicStatus['t'] songDuration=musicStatus['duration'] diff --git a/light9/effecteval/effect.py b/light9/effecteval/effect.py --- a/light9/effecteval/effect.py +++ b/light9/effecteval/effect.py @@ -133,7 +133,11 @@ class EffectNode(object): for c in self.codes: codeNs = ns.copy() codeNs.update(c.pyResources) - lineOut = eval(c.expr, codeNs) + try: + lineOut = eval(c.expr, codeNs) + except Exception as e: + e.expr = c.expr + raise e ns[c.outName] = lineOut if 'out' not in ns: log.error("ran code for %s, didn't make an 'out' value", self.uri) diff --git a/light9/effecteval/effectloop.py b/light9/effecteval/effectloop.py --- a/light9/effecteval/effectloop.py +++ b/light9/effecteval/effectloop.py @@ -147,6 +147,8 @@ class EffectLoop(object): except Exception as exc: now = time.time() if now > self.lastErrorLog + 5: + if hasattr(exc, 'expr'): + log.error('in expression %r', exc.expr) log.error("effect %s: %s" % (e.uri, exc)) self.lastErrorLog = now log.debug('eval %s effects, got %s outputs', len(self.currentEffects), len(outputs))