Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
14.5.0
-
None
-
Flagged
Description
#getMirrorPath calls #getPath and catches various types of RepositoryExceptions.
#getPath catches RepositoryException internally so this doesn't work as intended
result: always an error "Docbase not found" with long stack trace
expected: different warn, info, debug loggings in case of ValueFormatException, ItemNotFoundException or PathNotFoundexception
Full code:
private String getMirrorPath() { final Node node = MirrorTemplatePlugin.this.getModelObject(); try { if (node != null && node.hasProperty(HippoNodeType.HIPPO_DOCBASE)) { return getPath(node.getProperty(HippoNodeType.HIPPO_DOCBASE).getString()); } } catch (final ValueFormatException e) { log.warn("Invalid value format for docbase " + e.getMessage()); log.debug("Invalid value format for docbase ", e); } catch (final PathNotFoundException e) { log.warn("Docbase not found " + e.getMessage()); log.debug("Docbase not found ", e); } catch (final ItemNotFoundException e) { log.info("Docbase " + e.getMessage() + " could not be dereferenced"); } catch (final RepositoryException e) { log.error("Invalid docbase " + e.getMessage(), e); } return StringUtils.EMPTY; } private String getPath(final String docBaseUuid) { String path = StringUtils.EMPTY; try { if (StringUtils.isNotEmpty(docBaseUuid) && !docBaseUuid.equals(JcrConstants.ROOT_NODE_ID)) { path = getJcrSession().getNodeByIdentifier(docBaseUuid).getPath(); } } catch (final RepositoryException e) { log.error("Invalid docbase: '{}'", docBaseUuid, e); } return path; }
Attachments
Issue Links
- is duplicated by
-
CMS-12449 MirrorTemplatePlugin shouldn't log full stacktraces by default
- Closed