Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log ocs errors #4531

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ func (s *service) CreateShare(ctx context.Context, req *collaboration.CreateShar
ok, err := utils.CheckPermission(ctx, permission.WriteShare, gatewayClient)
if err != nil {
return &collaboration.CreateShareResponse{
Status: status.NewInternal(ctx, "failed check user permission to write public link"),
Status: status.NewInternal(ctx, "failed check user permission to write collaborative share"),
}, err
}
if !ok {
return &collaboration.CreateShareResponse{
Status: status.NewPermissionDenied(ctx, nil, "no permission to create public links"),
Status: status.NewPermissionDenied(ctx, nil, "no permission to create collaborative shares"),
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ func (h *Handler) createCs3Share(ctx context.Context, w http.ResponseWriter, r *
return nil, &ocsError{
Code: response.MetaForbidden.StatusCode,
Message: response.MessageShareExists,
Error: nil,
Error: errors.Errorf(createShareResponse.Status.Message),
}
case rpc.Code_CODE_INVALID_ARGUMENT:
return nil, &ocsError{
Expand Down
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocs/response/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func WriteOCSData(w http.ResponseWriter, r *http.Request, m Meta, d interface{},
func WriteOCSResponse(w http.ResponseWriter, r *http.Request, res Response, err error) {
if err != nil {
appctx.GetLogger(r.Context()).
Debug().
Error().
Err(err).
Str("ocs_msg", res.OCS.Meta.Message).
Msg("writing ocs error response")
Expand Down
Loading