File tree Expand file tree Collapse file tree
lib/live_debugger/gen_servers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ defmodule LiveDebugger.GenServers.StateServer do
1919
2020 @ doc """
2121 Returns previously stored state of the LiveView channel process identified by `pid`.
22- If the state is not found, it returns `{:error, :not_found}`.
22+ If the state is not found, it fetches it from the process.
23+ If the process is dead, it returns an error.
2324 """
2425 @ spec get ( pid :: pid ( ) ) :: { :ok , CommonTypes . channel_state ( ) } | { :error , term ( ) }
2526 def get ( pid ) when is_pid ( pid ) do
@@ -109,8 +110,11 @@ defmodule LiveDebugger.GenServers.StateServer do
109110
110111 def get ( pid ) do
111112 case :ets . lookup ( @ server_module . ets_table_name ( ) , @ server_module . record_id ( pid ) ) do
112- [ { _ , channel_state } ] -> { :ok , channel_state }
113- [ ] -> { :error , :not_found }
113+ [ { _ , channel_state } ] ->
114+ { :ok , channel_state }
115+
116+ [ ] ->
117+ ProcessService . state ( pid )
114118 end
115119 end
116120 end
You can’t perform that action at this time.
0 commit comments