s/ErrIllegalOffset/ErrMismatchOffset

This commit is contained in:
Naren Venkataraman 2015-11-04 04:37:37 -05:00
parent e451dc5f65
commit db67b862ae
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ var (
ErrInvalidOffset = errors.New("missing or invalid Upload-Offset header") ErrInvalidOffset = errors.New("missing or invalid Upload-Offset header")
ErrNotFound = errors.New("upload not found") ErrNotFound = errors.New("upload not found")
ErrFileLocked = errors.New("file currently locked") ErrFileLocked = errors.New("file currently locked")
ErrIllegalOffset = errors.New("illegal offset") ErrMismatchOffset = errors.New("mismatched offset")
ErrSizeExceeded = errors.New("resource's size exceeded") ErrSizeExceeded = errors.New("resource's size exceeded")
ErrNotImplemented = errors.New("feature not implemented") ErrNotImplemented = errors.New("feature not implemented")
ErrUploadNotFinished = errors.New("one of the partial uploads is not finished") ErrUploadNotFinished = errors.New("one of the partial uploads is not finished")
@ -44,7 +44,7 @@ var ErrStatusCodes = map[error]int{
ErrInvalidOffset: http.StatusBadRequest, ErrInvalidOffset: http.StatusBadRequest,
ErrNotFound: http.StatusNotFound, ErrNotFound: http.StatusNotFound,
ErrFileLocked: 423, // Locked (WebDAV) (RFC 4918) ErrFileLocked: 423, // Locked (WebDAV) (RFC 4918)
ErrIllegalOffset: http.StatusConflict, ErrMismatchOffset: http.StatusConflict,
ErrSizeExceeded: http.StatusRequestEntityTooLarge, ErrSizeExceeded: http.StatusRequestEntityTooLarge,
ErrNotImplemented: http.StatusNotImplemented, ErrNotImplemented: http.StatusNotImplemented,
ErrUploadNotFinished: http.StatusBadRequest, ErrUploadNotFinished: http.StatusBadRequest,
@ -320,7 +320,7 @@ func (handler *Handler) patchFile(w http.ResponseWriter, r *http.Request) {
} }
if offset != info.Offset { if offset != info.Offset {
handler.sendError(w, r, ErrIllegalOffset) handler.sendError(w, r, ErrMismatchOffset)
return return
} }