Skip to content

Commit a2d6202

Browse files
committed
Add debug log about error in handling actions
1 parent 5294057 commit a2d6202

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/membrane/core/callback_handler.ex

+18
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ defmodule Membrane.Core.CallbackHandler do
185185
Error handling actions returned by callback #{inspect(state.module)}.#{callback}
186186
""")
187187

188+
log_debug_orginal_error(actions, e, __STACKTRACE__)
189+
188190
reraise e, __STACKTRACE__
189191
end
190192

@@ -198,10 +200,26 @@ defmodule Membrane.Core.CallbackHandler do
198200
Error handling action #{inspect(action)} returned by callback #{inspect(state.module)}.#{callback}
199201
""")
200202

203+
log_debug_orginal_error(action, e, __STACKTRACE__)
204+
201205
reraise e, __STACKTRACE__
202206
end
203207
end)
204208

205209
handler_module.handle_end_of_actions(state)
206210
end
211+
212+
defp log_debug_orginal_error(action_or_actions, error, stacktrace) do
213+
action_or_actions =
214+
if(is_list(action_or_actions), do: "actions ", else: "action ") <>
215+
inspect(action_or_actions, limit: :infinity)
216+
217+
Membrane.Logger.debug("""
218+
Error while handling #{action_or_actions}
219+
220+
Orginal error:
221+
#{inspect(error, pretty: true, limit: :infinity)}
222+
#{Exception.format_stacktrace(stacktrace)}
223+
""")
224+
end
207225
end

test/membrane/integration/links_validation_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ defmodule Membrane.LinksValidationTest do
7474
]
7575

7676
{:error, {{%Membrane.LinkError{}, _stackstrace}, _meta}} =
77-
Pipeline.start_supervised(spec: spec)
77+
Pipeline.start_supervised(spec: [spec, spec])
7878
end
7979

8080
test "dynamic pads" do

0 commit comments

Comments
 (0)