Displaying error description in WebDAV response

I have built a WebDAV compliant server-side application, which is connected to Windows Web Folders. As I was doing some manual tests to confirm that the code does what it's supposed to do, I was wondering if there is any way to have a more detailed description of the error encountered by the server.

Example: I was trying to do a PUT for a file called 'other' in a collection which contained a collection called 'other'. The method failed for obvious reasons, but the response contained no information that could help the user identify what went wrong.

Thanks in advance.

PS: I suppose I could put the description in the HTTP body, which I assume it would be fine for clients like cadaver, but this approach won't work for Windows WebFolders.

Upvotes: 3

Views: 1139

Answers (3)

Brad at Kademi
Brad at Kademi

Reputation: 1320

all OS Webdav clients, and windows in particular, do not provide good feedback to the user about the cause of errors.

A frequent solution for business applications, where the email address of the current user is known, is for the server to simply email the full error message to the user. This is particularly useful for situations where errors can result from business rule violations.

Upvotes: 1

Seems that I have found the answer. What I was looking for was actually well documented in the WebDAV protocol.

Upvotes: 2

karthik
karthik

Reputation: 1291

As webdav make collection request is a simple HTTP request with method as 'MKCOL',you will get error code as response from the server . In your case you will receive 403(forbidden) error code.You can check locally your folder content ,if there is duplicate entry you give user custom error message.

Upvotes: 0

Related Questions