mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Move json errors over to gmsl (#3080)
This commit is contained in:
parent
a49c9f01e2
commit
0489d16f95
109 changed files with 808 additions and 1217 deletions
|
@ -141,8 +141,8 @@ func (r *Admin) PerformAdminEvacuateRoom(
|
|||
Asynchronous: true,
|
||||
}
|
||||
inputRes := &api.InputRoomEventsResponse{}
|
||||
err = r.Inputer.InputRoomEvents(ctx, inputReq, inputRes)
|
||||
return affected, err
|
||||
r.Inputer.InputRoomEvents(ctx, inputReq, inputRes)
|
||||
return affected, nil
|
||||
}
|
||||
|
||||
// PerformAdminEvacuateUser will remove the given user from all rooms.
|
||||
|
@ -334,9 +334,7 @@ func (r *Admin) PerformAdminDownloadState(
|
|||
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
||||
})
|
||||
|
||||
if err = r.Inputer.InputRoomEvents(ctx, inputReq, inputRes); err != nil {
|
||||
return fmt.Errorf("r.Inputer.InputRoomEvents: %w", err)
|
||||
}
|
||||
r.Inputer.InputRoomEvents(ctx, inputReq, inputRes)
|
||||
|
||||
if inputRes.ErrMsg != "" {
|
||||
return inputRes.Err()
|
||||
|
|
|
@ -226,9 +226,7 @@ func (r *Inviter) PerformInvite(
|
|||
},
|
||||
}
|
||||
inputRes := &api.InputRoomEventsResponse{}
|
||||
if err = r.Inputer.InputRoomEvents(context.Background(), inputReq, inputRes); err != nil {
|
||||
return nil, fmt.Errorf("r.Inputer.InputRoomEvents: %w", err)
|
||||
}
|
||||
r.Inputer.InputRoomEvents(context.Background(), inputReq, inputRes)
|
||||
if err = inputRes.Err(); err != nil {
|
||||
logger.WithError(err).WithField("event_id", event.EventID()).Error("r.InputRoomEvents failed")
|
||||
return nil, api.ErrNotAllowed{Err: err}
|
||||
|
|
|
@ -313,9 +313,7 @@ func (r *Joiner) performJoinRoomByID(
|
|||
},
|
||||
}
|
||||
inputRes := rsAPI.InputRoomEventsResponse{}
|
||||
if err = r.Inputer.InputRoomEvents(ctx, &inputReq, &inputRes); err != nil {
|
||||
return "", "", rsAPI.ErrNotAllowed{Err: err}
|
||||
}
|
||||
r.Inputer.InputRoomEvents(ctx, &inputReq, &inputRes)
|
||||
if err = inputRes.Err(); err != nil {
|
||||
return "", "", rsAPI.ErrNotAllowed{Err: err}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/internal/eventutil"
|
||||
"github.com/matrix-org/gomatrix"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
@ -115,7 +114,7 @@ func (r *Leaver) performLeaveRoomByID(
|
|||
// mimic the returned values from Synapse
|
||||
res.Message = "You cannot reject this invite"
|
||||
res.Code = 403
|
||||
return nil, jsonerror.LeaveServerNoticeError()
|
||||
return nil, spec.LeaveServerNoticeError()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,9 +202,7 @@ func (r *Leaver) performLeaveRoomByID(
|
|||
},
|
||||
}
|
||||
inputRes := api.InputRoomEventsResponse{}
|
||||
if err = r.Inputer.InputRoomEvents(ctx, &inputReq, &inputRes); err != nil {
|
||||
return nil, fmt.Errorf("r.Inputer.InputRoomEvents: %w", err)
|
||||
}
|
||||
r.Inputer.InputRoomEvents(ctx, &inputReq, &inputRes)
|
||||
if err = inputRes.Err(); err != nil {
|
||||
return nil, fmt.Errorf("r.InputRoomEvents: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue