Skip to content

Improve docs#1103

Open
Noarkhh wants to merge 3 commits intoimprove-error-messagesfrom
improve-docs
Open

Improve docs#1103
Noarkhh wants to merge 3 commits intoimprove-error-messagesfrom
improve-docs

Conversation

@Noarkhh
Copy link
Contributor

@Noarkhh Noarkhh commented Mar 19, 2026

No description provided.

@Noarkhh Noarkhh requested a review from mat-hek as a code owner March 19, 2026 12:57
@Noarkhh Noarkhh marked this pull request as draft March 19, 2026 12:57
@Noarkhh Noarkhh self-assigned this Mar 19, 2026
@Noarkhh Noarkhh added this to Smackore Mar 19, 2026
@Noarkhh Noarkhh moved this to In Progress in Smackore Mar 19, 2026
@Noarkhh Noarkhh linked an issue Mar 24, 2026 that may be closed by this pull request
@Noarkhh Noarkhh marked this pull request as ready for review March 24, 2026 15:01
@Noarkhh Noarkhh moved this from In Progress to In Review in Smackore Mar 24, 2026
@Noarkhh Noarkhh requested review from FelonEkonom and varsill March 24, 2026 15:06
* their pads cannot use manual demands
* the first filter must make demands in buffers
"""
@moduledoc deprecated: "This module is deprecated, use Membrane.Bin instead"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NIT] I am not sure, but I feel like it requires a little bit more of a context, something like: "if you need to aggregate children into a single component, use Membrane.Bin.
(the point is that' I am not sure if it's always a valid clue to use Membrane.Bin when one tried using the FilterAggregator)

"This action cannot be returned by a #{element_type |> Atom.to_string() |> String.capitalize()}."
end

defp format_reason({:invalid_element_callback_combination, element_type, callback}) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be more like component_type, to make it generic for elements/bins/pipelines?

Comment on lines +20 to +28
Although Endpoints may seem similair to [Filters](`m:Membrane.Filter`), there are
some important differences. While Filters can be thought as parts of a Pipeline that
take in data, process it in some way, and then pass it along, Endpoints create
"holes" in the pipeline. They behave more like a [Sink](`m:Membrane.Sink`) and a
[Source](`m:Membrane.Source`) in a single element - media they consume and produce are
parts of different streams. The main consequence of this is the fact that
they separate the flow control of the pipeline ahead of them and behind them,
and in turn their input pads behave like ones of a Sink, and their output pads behave
like ones of a Source.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although Endpoints may seem similair to [Filters](`m:Membrane.Filter`), there are
some important differences. While Filters can be thought as parts of a Pipeline that
take in data, process it in some way, and then pass it along, Endpoints create
"holes" in the pipeline. They behave more like a [Sink](`m:Membrane.Sink`) and a
[Source](`m:Membrane.Source`) in a single element - media they consume and produce are
parts of different streams. The main consequence of this is the fact that
they separate the flow control of the pipeline ahead of them and behind them,
and in turn their input pads behave like ones of a Sink, and their output pads behave
like ones of a Source.
Although Endpoints may seem similair to [Filters](`m:Membrane.Filter`), there are
some important differences. While Filters can be thought as parts of a Pipeline that
take in data, process it in some way, and then pass it along, Endpoints create
"holes" in the pipeline. They behave more like a [Sink](`m:Membrane.Sink`) and a
[Source](`m:Membrane.Source`) combined in a single element - media they consume and produce are parts of different streams. The main consequence of this is the fact that
they separate the flow control of the pipeline ahead of them and behind them,
as their input pads behave like those of a Sink, and their output pads behave
like those of a Source.

"Invalid config keys:\n" <> invalid_keys_reasons

other ->
"Invalid pad config: #{other}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Invalid pad config: #{other}"
"Invalid pad config: #{inspect(other)}"

"Duplicate keys in pad config: #{inspect(duplicates)}"

{:config_field, {:key_not_found, :flow_control}}
when component != :filter and direction == :output ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JUST A THOUGHT :D] It looks as if we are repeating the conditions specified in parse_pad_spec() - perhaps Bunch.Config.parse() should accept error message as one of its arguments?

Comment on lines +151 to +153
if type == :sink do
raise ActionError, action: action, reason: {:invalid_element, type}
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks as if there is a plenty of places where you check if type == <some element type> and then you raise {:invalid_element, type} - wouldn't it be possible to add guards checking expected types of elements in these handle_action clauses (just as it use to be) and raise invalid_element in fallback handle_action implementation?

@Noarkhh Noarkhh changed the base branch from master to improve-error-messages March 25, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[docs] More info on terminating pipelines gracefully [docs] What's the difference between Filter and Endpoint? Deprecate Membrane.FilterAggregator

2 participants