mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Fix logging
This commit is contained in:
parent
1a178473c7
commit
a0e256711d
|
|
@ -162,13 +162,13 @@ func MakeJoin(
|
||||||
switch e := internalErr.(type) {
|
switch e := internalErr.(type) {
|
||||||
case nil:
|
case nil:
|
||||||
case spec.InternalServerError:
|
case spec.InternalServerError:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request")
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusInternalServerError,
|
Code: http.StatusInternalServerError,
|
||||||
JSON: spec.InternalServerError{},
|
JSON: spec.InternalServerError{},
|
||||||
}
|
}
|
||||||
case spec.MatrixError:
|
case spec.MatrixError:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request")
|
||||||
code := http.StatusInternalServerError
|
code := http.StatusInternalServerError
|
||||||
switch e.ErrCode {
|
switch e.ErrCode {
|
||||||
case spec.ErrorForbidden:
|
case spec.ErrorForbidden:
|
||||||
|
|
@ -186,13 +186,13 @@ func MakeJoin(
|
||||||
JSON: e,
|
JSON: e,
|
||||||
}
|
}
|
||||||
case spec.IncompatibleRoomVersionError:
|
case spec.IncompatibleRoomVersionError:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request")
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: e,
|
JSON: e,
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request")
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.Unknown("unknown error"),
|
JSON: spec.Unknown("unknown error"),
|
||||||
|
|
|
||||||
|
|
@ -101,13 +101,13 @@ func MakeLeave(
|
||||||
switch e := internalErr.(type) {
|
switch e := internalErr.(type) {
|
||||||
case nil:
|
case nil:
|
||||||
case spec.InternalServerError:
|
case spec.InternalServerError:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request")
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusInternalServerError,
|
Code: http.StatusInternalServerError,
|
||||||
JSON: spec.InternalServerError{},
|
JSON: spec.InternalServerError{},
|
||||||
}
|
}
|
||||||
case spec.MatrixError:
|
case spec.MatrixError:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request")
|
||||||
code := http.StatusInternalServerError
|
code := http.StatusInternalServerError
|
||||||
switch e.ErrCode {
|
switch e.ErrCode {
|
||||||
case spec.ErrorForbidden:
|
case spec.ErrorForbidden:
|
||||||
|
|
@ -123,7 +123,7 @@ func MakeLeave(
|
||||||
JSON: e,
|
JSON: e,
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
util.GetLogger(httpReq.Context()).WithError(internalErr)
|
util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request")
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.Unknown("unknown error"),
|
JSON: spec.Unknown("unknown error"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue