Skip to content

Commit

Permalink
Add assertion on value passed with :setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Jan 29, 2024
1 parent ed06281 commit 0e40638
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/membrane/core/lifecycle_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,13 @@ defmodule Membrane.Core.LifecycleController do
"""
end

defp assert_operation_allowed!(operation, _status)
when operation not in [:incomplete, :complete] do
raise SetupError, """
Action {:setup, #{inspect(operation)}} was returned, but second element in the tuple must
be :complete or :incomplete
"""
end

defp assert_operation_allowed!(_operation, _status), do: :ok
end

0 comments on commit 0e40638

Please sign in to comment.