Skip to content

Commit f443f0c

Browse files
authored
ignore unknown request types (#1092)
1 parent 1855336 commit f443f0c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/eventloop.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function eventloop(socket)
55
msg = recv_ipython(socket)
66
try
77
send_status("busy", msg)
8-
invokelatest(handlers[msg.header["msg_type"]], socket, msg)
8+
invokelatest(get(handlers, msg.header["msg_type"], unknown_request), socket, msg)
99
catch e
1010
# Try to keep going if we get an exception, but
1111
# send the exception traceback to the front-ends.

src/handlers.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ function interrupt_request(socket, msg)
274274
send_ipython(requests[], msg_reply(msg, "interrupt_reply", Dict()))
275275
end
276276

277+
function unknown_request(socket, msg)
278+
@vprintln("UNKNOWN MESSAGE TYPE $(msg.header["msg_type"])")
279+
end
280+
277281
const handlers = Dict{String,Function}(
278282
"execute_request" => execute_request,
279283
"complete_request" => complete_request,

0 commit comments

Comments
 (0)