ti 11. lokak. 2022 klo 11.12 Korbinian Bachl (korbinian.ba...@whiskyworld.de) kirjoitti:
> > > > > It is your application so you must know/design how to recover from the > > error. You either re-render the same page or redirect the user to a > > suitable error page. > > > > ** > > Martin > > > > Thats exactly the misunderstanding. If one of 100s of components fails - > not even necessarily "made" by myself (.g.: some null pointer down the > drain of a Panel) - why should the whole rest of the page fail, too? > Why should we redirect and not just ignore the single root cause (a "bad" > component/ panel) silently? > > I mean, most of errors that occur in Prod for us are because something > happens that was never meant to be. Be it that backend data came in that > violated the contract (because of update of a third party service without > notice / or in error) or something else that is not know in advance. > > Point is: if a page consists of 1000 Components and only 1 of it fails: > why has this single point of failure the need to take down the rest of the > page? > I think you should think of it like a transaction. A well designed page is like a transaction. If there is a fault, it should rollback everything. Otherwise, you need to design very carefully which faults you want to allow and which ones not. A quick-and-dirty way is to add catches to the sub panel rendering phases so that they don't care about the faults, but you will run a risk that your user is not getting consistent information. This might be a problem or it might not be. Also, if you have lots of these, you probably have some sort of systematic design flaw in your application, try to debug heuristically it and solve it. In my experience, the only situations where exceptions are "normal" in wicket is when there is some kind of invalid session and parts of the page attempt rendering while some other parts fail to render, and the correct action in such case is to discard rendering and redirect to login. But your case might be different and you need to investigate the root cause. Otherwise you run risk of steering your product like a lost ship on the vast ocean with some unexpected harm ahead. To summarize, unexpected exceptions in wicket are not normal, you should not allow them. ** Martin