enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Better handling of "unknown branch" #7348

Closed sigdestad closed 4 years ago

sigdestad commented 5 years ago

Can we handle things better when accessing a url to an unknown/missing branch? Currently we get this in the log:

2019-09-03 07:11:58,857 ERROR c.e.x.p.i.e.ExceptionRendererImpl - Exception while executing custom error handler com.enonic.xp.repository.BranchNotFoundException: Branch with id [master-no] not found at com.enonic.xp.repo.impl.node.NodeServiceImpl.lambda$verifyBranchExists$11(NodeServiceImpl.java:1092) at com.enonic.xp.context.ContextImpl.runWith(ContextImpl.java:85) at com.enonic.xp.repo.impl.node.NodeHelper.runAsAdmin(NodeHelper.java:15) at com.enonic.xp.repo.impl.node.NodeServiceImpl.verifyBranchExists(NodeServiceImpl.java:1081) at com.enonic.xp.repo.impl.node.NodeServiceImpl.verifyContext(NodeServiceImpl.java:1063) at com.enonic.xp.repo.impl.node.NodeServiceImpl.executeGetByPath(NodeServiceImpl.java:182) at com.enonic.xp.repo.impl.node.NodeServiceImpl.getByPath(NodeServiceImpl.java:166) at com.enonic.xp.core.impl.content.GetContentByPathCommand.execute(GetContentByPathCommand.java:28) at com.enonic.xp.core.impl.content.ContentServiceImpl.executeGetByPath(ContentServiceImpl.java:639) at com.enonic.xp.core.impl.content.ContentServiceImpl.getByPath(ContentServiceImpl.java:617) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.lambda$resolveSiteFromPath$0(ExceptionRendererImpl.java:176) at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:101) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.runAsContentAdmin(ExceptionRendererImpl.java:198) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.resolveSiteFromPath(ExceptionRendererImpl.java:176) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.doRenderCustomError(ExceptionRendererImpl.java:130) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.renderCustomError(ExceptionRendererImpl.java:109) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.render(ExceptionRendererImpl.java:77) at com.enonic.xp.portal.impl.exception.ExceptionRendererImpl.render(ExceptionRendererImpl.java:43) at com.enonic.xp.portal.handler.BasePortalHandler.handleError(BasePortalHandler.java:61) at com.enonic.xp.portal.handler.BasePortalHandler.doHandle(BasePortalHandler.java:52) at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:66) at com.enonic.xp.web.impl.handler.WebHandlerChainImpl.handle(WebHandlerChainImpl.java:30) at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:75) at com.enonic.xp.web.impl.handler.WebHandlerChainImpl.handle(WebHandlerChainImpl.java:30) at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:75) at com.enonic.xp.web.impl.handler.WebHandlerChainImpl.handle(WebHandlerChainImpl.java:30) at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:75)

GlennRicaud commented 4 years ago

There should be exception. We can discuss if you want to change the rendering of exception