You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the reva ocdav webdav handler followcs a mixed approach to error handling:
case MethodLock:
status, err = s.handleLock(w, r, ns)
...
case MethodMove:
s.handlePathMove(w, r, ns)
...
default:
w.WriteHeader(http.StatusNotFound)
}
if status != 0 { // 0 means the handler already sent the response
w.WriteHeader(status)
if status != http.StatusNoContent {
var b []byte
if b, err = errors.Marshal(status, err.Error(), ""); err == nil {
_, err = w.Write(b)
}
}
}
if err != nil {
appctx.GetLogger(r.Context()).Error().Err(err).Msg(err.Error())
}
All handlers should return a status and err, so the generic error handling can take place. In case the handler needs to handle a special case it can devactivate the generic handling by returning status = 0.
This will prevent and fix bugs where we don't render the xml body in an error case, eg:
Currently, the reva ocdav webdav handler followcs a mixed approach to error handling:
All handlers should return a
status
anderr
, so the generic error handling can take place. In case the handler needs to handle a special case it can devactivate the generic handling by returningstatus = 0
.This will prevent and fix bugs where we don't render the xml body in an error case, eg:
It will make returning a special message easier, eg. for #773
The text was updated successfully, but these errors were encountered: