Commits

Ludvig Ericson committed 8b27620

Only set exception after function call if not set

  • Participants
  • Parent commits c585b62

Comments (0)

Files changed (1)

spidermonkey/jsfunction.c

 
     if(!JS_CallFunctionValue(cx, parent, func, argc, argv, &rval))
     {
-        PyErr_SetString(PyExc_RuntimeError, "Failed to execute JS Function.");
+        if(!PyErr_Occurred()) {
+            PyErr_SetString(PyExc_RuntimeError, "JavaScript Function failed to execute");
+        }
         goto error;
     }