Avoid usage of instanceof to check for WebDAV exceptions