Trying to pattern match against a GenServer exception, however the error message is written in Erlang:
2021-12-22T09:33:56.601136+00:00 error: crasher: initial call: 'Elixir.MyGenServer':'-handle_info/2-fun-0-'/0, pid: <0.3813.873>, registered_name: [], exit: {{timeout,{gen_server,call,[py_pool,{checkout,#Ref<0.2885861564.3326083073.228601>,true},60000]}},[{gen_server,call,3,[{file,"gen_server.erl"},{line,247}]},{poolboy,checkout,3,[{file,"/home/MyApp/deps/poolboy/src/poolboy.erl"},{line,63}]},{poolboy,transaction,3,[{file,"/home/MyApp/deps/poolboy/src/poolboy.erl"},{line,82}]},{'Elixir.Task.Supervised',invoke_mfa,2,[{file,"lib/task/supervised.ex"},{line,90}]},{'Elixir.Task.Supervised',reply,5,[{file,"lib/task/supervised.ex"},{line,35}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}, ancestors: ['Elixir.MyGenServer',<0.388.0>,'Elixir.MyApp.Supervisor',<0.335.0>], message_queue_len: 0, messages: [], links: [<0.389.0>], dictionary: [{'$callers',[<0.389.0>]}], trap_exit: false, status: running, heap_size: 17731, stack_size: 29, reductions: 31491; neighbours:
My attempt:
defmodule MyGenServer do
use GenServer
require Logger
@impl true
def handle_info(error, state) do
Logger.error(error)
{:noreply, state}
end
end
How should handle_info
be modified to catch this exception?