This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
Refactor cross-boundary error handling #1441
Labels
C-Polylith
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
X-Fix-With-Monolith
This issue can be resolved with a monolith-only arch
Errors in Dendrite are a mess.
The client API has
jsonerror.MatrixError
, which is nice because those are the things that are returned to clients, although it is maybe misplaced since we also might want to use those in the federation API.gomatrix also has
*gomatrix.HTTPError
, and then in some places we haveroomserverAPI.PerformError
, and in other places we just throw regular opaque errors around. In some API functions we putPerformError
s into the response struct, in others we just return anerror
from the function itself.This makes it really difficult to return meaningful clients and other federated servers to errors consistently in any place that an API query is performed.
We should do the work to ensure that if we provide a
jsonerror.MatrixError
, that it is correctly marshalled and unmarshalled across API boundaries and that they make it all the way back to clients/federation endpoints, and tidy up the rest of the mess so that it's consistent and usable.The text was updated successfully, but these errors were encountered: