[new/old webdav] Locking non-existent resources returns 500 instead of 404
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
## Describe the bug
In the **old/new** DAV version, locking a non-existent resource responds with the **`500`** http status code and
unuseful error message
## Steps to reproduce
Steps to reproduce the behavior:
1. create user `user1`
2. lock a non-existent resource `lorem.txt`
```
curl -k -u user1:password -X LOCK https://host.docker.internal:9200/remote.php/dav/files/user1/lorem.txt -d " " -v
```
## Expected behavior
In **spaces** dav version
`< HTTP/1.1 404 Not Found`
```
Sabre\DAV\Exception\NotFoundFile not found in root%
```
## Actual behavior
In **old/new** dav version
`HTTP/1.1 500 Internal Server Error`
```
error: not found: set lock: error: not found: ddc2004c-0977-11eb-9d3f-a793888cd0f8/addd%
```
## Setup
Please describe how you started the server and provide a list of relevant environment variables.
```console
OCIS_VERSION= latest
BRANCH= master
```
## Additional context
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.