cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Error Handling

Former Member
0 Kudos

Hi all,

i have an exception handling problem in web dynpro. For my app (WEB AS 6.40 SP 15) i need an exception handler to catch all exceptions before the overall errorpage is shown (because there you cannot log, clean up resources and show an individual error messages to the user).

In case of such an exception handler i don´t have spread try/catch blocks all over the WD code to catch exceptions the app cannot recover from.

Does anyone has a suggestion whether a hook or something else exists in web dynpro (e.g. something like the error page mapping in a servlet container?)

Thanks for help

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

sridhar_k2
Active Contributor
0 Kudos

Hi,

As i know, we don't have any ready made solution, where all the errors can track. Instead you can create generic page(error page), redirect it to this page whenever you got any error.

To redirect to the error page u can create erroPlug and point it to that. In your catch block point to the errorpage whenever you got error.

Regards,

Sridhar

Former Member
0 Kudos

Hi Sridhar,

thanks for the reply but this only helps a bit because i don´t know which exception can be thrown at any piece of code. For example there are many unchecked exceptions where i do not need a catch and there are are many WebDynproExceptions too. For all these exceptions i do not know the place and time (at the phase model) where they occur so i have the need of one hook to catch all possible exceptions before the response goes to the user (in case of an unhandeled exception an predefined errorpage with or without the stacktrace).

Regards,

Christian

sridhar_k2
Active Contributor
0 Kudos

Hi Christian,

You catch all possible exceptions with appropriate handlers(Catch). In the end catch with Exception, which is the base class for all exceptions. Any exception will be caught here.

try{

}catch(Exception ee){}

Regards,

Sridhar

Former Member
0 Kudos

Hi,

Refer to the help link on 'Error Handling',

http://help.sap.com/saphelp_nw04/helpdata/en/d1/1937e802d4ef4597fa14c48e66ca5d/content.htm

Regards

Srinivasan T

Former Member
0 Kudos

I think thats not what he is after. The catch exception could be possible but where to put it? There isnt like a method which kicks of the whole application like a

public static void main(String[] args) for example.

Is there a handler or hook which is triggered when a non-caught exception is thrown?

regards,

Hugo

Former Member
0 Kudos

Hi Hugo,

that is exactly what i´m looking for

If you are building a desktop-app e.g. based on swing, you can use ThreadGruop.uncaughtException to handle ALL exceptions before the thread is closed by the VM.

If you are using a Servletcontainer you can configure an error-page which is mapped to a special exception e.g. Throwable. This error-page can be implemented as a normal servlet so you can do ALL of your necessary error handling there.

These are two ways to clean up resources and do some last logging in case an error occures the app cannot recover from.

Is there anything comparable in WebDynpro?

Regards,

Christian

Former Member
0 Kudos

hi Christian,

Were you able to find any solution?

thanks,

Sanketh