Is the string that's being constructed here supposed to be valid JavaScript?  Right now `traceback.format_exc()` will add additional quotes, which would make the syntax invalid, but even without `(a,b)` in JavaScript will just evaluate to `b`.

If the error message is supposed to be interpreted, something like `'["error in call","%s"]' % json.dumps(traceback.format_exc())` would be needed, or even better `json.dumps(["error in call", traceback.format_exc()])`.