Skip to content

Commit

Permalink
ignore unknown request types (#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored May 28, 2024
1 parent 1855336 commit f443f0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/eventloop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function eventloop(socket)
msg = recv_ipython(socket)
try
send_status("busy", msg)
invokelatest(handlers[msg.header["msg_type"]], socket, msg)
invokelatest(get(handlers, msg.header["msg_type"], unknown_request), socket, msg)
catch e
# Try to keep going if we get an exception, but
# send the exception traceback to the front-ends.
Expand Down
4 changes: 4 additions & 0 deletions src/handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ function interrupt_request(socket, msg)
send_ipython(requests[], msg_reply(msg, "interrupt_reply", Dict()))
end

function unknown_request(socket, msg)
@vprintln("UNKNOWN MESSAGE TYPE $(msg.header["msg_type"])")
end

const handlers = Dict{String,Function}(
"execute_request" => execute_request,
"complete_request" => complete_request,
Expand Down

0 comments on commit f443f0c

Please sign in to comment.