membrane_core
membrane_core copied to clipboard
Disallow returning error tuple from callbacks
We found out that there's no generic enough way to handle {:error, reason}
tuples returned from callbacks. Currently, errors that can be recovered from are now handled with use of configuration/lambdas passed via options. Fatal errors, on the other hand, are raise
d. That works pretty well and makes returning {:error, reason}
pointless. Therefore, we shouldn't allow returning them anymore. In that case, returning :ok
tuples doesn't make much sense though. So we could have
-
{actions, state}
- when user wants to return actions -
state
- when user wants to return only state
That could be ambiguous if someone used a {list, term}
for the state, so we'd have to either enforce the state to be a map or struct, or require returning {:ok, state}
or {[], state}
.
We should consider whether to deprecate or remove support for the old return values