Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Reporting exceptions on the client ui(Reporting exceptions on the client ui)
Reporting exceptions on the client ui [message #1818372] Fri, 13 December 2019 13:36 Go to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 13
Registered: January 2012
Junior Member
Good day,

I would like to display a message box for any exceptions that are thrown from the server instead of the default message box that is displayed.

What I am struggling with is that if I throw a checked or runtime exception, the information in the exception is lost and a generic ProcessingException is received by the client.

I have tried to throw a custom ProcessingException (much like the VetoException) but that also becomes a generic ProcessingException on the client. The ProcessException would be perfect because I could encode the context of the exception and provide processing status information.

I have a suspicion that I might have to provide a subclass of DefaultRuntimeExceptionTranslator that handles this case for me. If this is correct then could you please indicate where the translator should be registered or should I provide it via @Replace?

Kind regards,
Mark Ashworth
Re: Reporting exceptions on the client ui [message #1818373 is a reply to message #1818372] Fri, 13 December 2019 14:12 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 154
Registered: September 2011
Senior Member
Hi Mark

You are right: Exceptions thrown on the backend are transformed before sending to the client. This is important for security reasons. Because such exceptions might leak sensitive information (like e.g. database setups if the exceptions occur because the database could not be reached) or implementation details to the caller. Depending on the exception such details might event be displayed to end users.

This transformation is performed in the method 'interceptException' of the bean 'org.eclipse.scout.rt.server.ServiceOperationInvoker' on the backend and may be modified by replacing this bean in your code (subclass the bean and annotate it with @Replace). But we do not recommend it because of the risk to send sensitive details to clients.

If you want to send more details to the client, you can use a 'VetoException'. The title, html message, code and severity of such exceptions is sent to the client.

Hope this helps
Mat
Re: Reporting exceptions on the client ui [message #1818548 is a reply to message #1818373] Thu, 19 December 2019 10:39 Go to previous message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 13
Registered: January 2012
Junior Member
Good day Mat,

Thank you.

I had a look at the 'interceptException' method and it makes sense why the exceptions are being translated. I will utilize the VetoException for the use case.

Kind regards,
Mark Ashworth


Previous Topic:Firebase Authentication and Cloud Firestore
Next Topic:How to Hide the tow button in Page
Goto Forum:
  


Current Time: Sat Jun 06 05:17:16 GMT 2020

Powered by FUDForum. Page generated in 0.02083 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top