mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Tweak error handling
This commit is contained in:
parent
2e9a727620
commit
38fa483091
3 changed files with 6 additions and 6 deletions
|
@ -116,11 +116,11 @@ func (r *FederationSenderInternalAPI) PerformJoin(
|
|||
// Clear the wrapped error, else serialising to JSON (in polylith mode) will fail
|
||||
httpErr.WrappedError = nil
|
||||
response.LastError = &httpErr
|
||||
} else if na, ok := lastErr.(*gomatrixserverlib.NotAllowed); ok {
|
||||
} else if errors.Is(lastErr, &gomatrixserverlib.NotAllowed{}) {
|
||||
response.LastError = &gomatrix.HTTPError{
|
||||
Code: http.StatusForbidden,
|
||||
WrappedError: na,
|
||||
Message: na.Message,
|
||||
WrappedError: lastErr,
|
||||
Message: lastErr.Error(),
|
||||
}
|
||||
} else {
|
||||
response.LastError = &gomatrix.HTTPError{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue