Skip to content

Commit

Permalink
Process callback events on error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 7, 2016
1 parent 20bd545 commit f1a7e99
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,14 @@ class Callback(object):
msg = JSON.parse(msg.content.data);
var comm = HoloViewsWidget.comms["{comms_target}"];
var comm_state = HoloViewsWidget.comm_state["{comms_target}"];
if (msg.msg_type == "Ready") {{
if (msg.content) {{
console.log("Python callback returned following output:", msg.content);
}}
if (comm_state.event) {{
comm.send(comm_state.event);
}} else {{
comm_state.blocked = false;
}}
comm_state.timeout = Date.now();
comm_state.event = undefined;
}} else if (msg.msg_type == "Error") {{
if (comm_state.event) {{
comm.send(comm_state.event);
}} else {{
comm_state.blocked = false;
}}
comm_state.timeout = Date.now();
comm_state.event = undefined;
if (msg.msg_type == "Error") {{
console.log("Python failed with the following traceback:", msg['traceback'])
}}
}}
Expand Down

0 comments on commit f1a7e99

Please sign in to comment.