Skip to content

Commit

Permalink
Improved log levels for WebDAV access.
Browse files Browse the repository at this point in the history
  • Loading branch information
gWestenberger committed Oct 1, 2024
1 parent ff73d14 commit 23eca14
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/org/opencms/webdav/CmsDavResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import org.opencms.file.CmsResource;
import org.opencms.file.CmsVfsResourceNotFoundException;
import org.opencms.i18n.CmsMessageContainer;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.repository.CmsPropertyName;
Expand Down Expand Up @@ -666,10 +667,22 @@ private I_CmsRepositoryItem getItem() {
m_item = Optional.of(item);

} catch (Exception e) {
if (!(e instanceof CmsVfsResourceNotFoundException)) {
LOG.error(e.getLocalizedMessage(), e);
} else {
boolean isFiltered = false;
if (e instanceof CmsException) {
CmsMessageContainer messageContainer = ((CmsException)e).getMessageContainer();
if (messageContainer != null) {
String messageKey = messageContainer.getKey();
if (org.opencms.repository.Messages.ERR_ITEM_FILTERED_1.equals(messageKey)) {
isFiltered = true;
}
}
}
if (e instanceof CmsVfsResourceNotFoundException) {
LOG.info(e.getLocalizedMessage(), e);
} else if (isFiltered) {
LOG.warn(e.getLocalizedMessage(), e);
} else {
LOG.error(e.getLocalizedMessage(), e);
}
m_item = Optional.empty();

Expand Down

0 comments on commit 23eca14

Please sign in to comment.