Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
mark unwrapFirstError deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Mar 1, 2022
1 parent eb152c8 commit 95d2bcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion synapse/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def _handle_frozendict(obj: Any) -> Dict[Any, Any]:


def unwrapFirstError(failure: Failure) -> Failure:
# defer.gatherResults and DeferredLists wrap failures.
# Deprecated: you probably just want to catch defer.FirstError and reraise
# the subFailure's value, which will do a better job of preserving stacktraces.
# (actually, you probably want to use yieldable_gather_results anyway)
failure.trap(defer.FirstError)
return failure.value.subFailure # type: ignore[union-attr] # Issue in Twisted's annotations

Expand Down

0 comments on commit 95d2bcb

Please sign in to comment.