mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-11 09:27:47 +08:00
Better handle exceptions in smart cells
This commit is contained in:
parent
ac67abd4e3
commit
713d1a55be
2 changed files with 7 additions and 3 deletions
|
@ -104,8 +104,12 @@ defmodule Livebook.Runtime.ErlDist.LoggerGLBackend do
|
|||
end
|
||||
|
||||
defp io_proxy?(pid) do
|
||||
info = Process.info(pid, [:dictionary])
|
||||
info[:dictionary][:"$initial_call"] == {Livebook.Runtime.Evaluator.IOProxy, :init, 1}
|
||||
try do
|
||||
info = Process.info(pid, [:dictionary])
|
||||
info[:dictionary][:"$initial_call"] == {Livebook.Runtime.Evaluator.IOProxy, :init, 1}
|
||||
rescue
|
||||
_ -> false
|
||||
end
|
||||
end
|
||||
|
||||
def async_io(device, output) when is_pid(device) do
|
||||
|
|
|
@ -423,7 +423,7 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
|||
put_in(state.smart_cells[ref], info)
|
||||
|
||||
{:error, error} ->
|
||||
Logger.error("failed to start smart cell, reason: #{inspect(error)}")
|
||||
Logger.error("failed to start smart cell - #{Exception.format_exit(error)}")
|
||||
state
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue