Discussion

Exception Handling, HTTP service

I am using a HTTP service to create a work object and process it through a flow. I would like to capture all the errors/exceptions in the transition and send it back as response.I could get only those messages that were on the clipboard page. But I would like to capture other exceptions like null pointer or any low level (like how tracer shows). Is there a way of doing it? Can I get any sample java code to use?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
January 6, 2009 - 1:11pm

The only thing I can think of is to use the transition flag in an activity (in one step call another activity and check for exceptions). Off the top of my head I am not sure what exceptions that will trap - if that doesn't cut it, then you could always drop back to a java step and wrap the call to an activity in a try / catch.

Happy new year!

Pega
December 3, 2008 - 9:14am

Sridhar, I would recommend a wrapper activity that calls the activity that actually does the work. Do all your error trapping in this wrapper. Create one property for an error flag and another for error messages. Then in the service rule, use a when condition to look for the error condition and format a response using your error message property. Hope this helps.

December 23, 2008 - 2:35am

Dave, Thanks for the response and sorry for delay in replying. The error trapping is the difficult part we are facing. Clipboard does not show all the errors/exceptions and any engine generated exceptions were shown in tracer or logs only. Even we want to capture those exceptions and send them as response. Only some exceptions like database or thrown exceptions we could caught so far. But is there a way to capture each and every exception that occurs in the background and shows only in logs/tracer? Also can we handle those? We tried with PRRuntimeException but it does not have a handler.

Please let me know your thoughts.

May 12, 2016 - 11:47am

Use on Exception check box ticked in each step expected to get exception while/after processing. Then set the error code and error message, in fault tab format a error message using error message property.