Try-Catch or Scope

Try-Catch or Scope

  
Is there a TRY Block or a Container or scope inside an Action which can catch exception of that block. 

I have an ACTION F1 created containing lot of operations in it and invoking F2 from it, i just want to catch exceptions which are thrown by F2 and ignore it to continue with other actions. How can i achive this. 
Hi Vasanth,

Currently, there is no try ... catch element that you can use directly in your actions, and each action has its scope.

You can achieve this behavior by creating the logic you want to include in your try ... catch block, inside a new user action that you create specifically for each block, catching the multiple exceptions you might be trying to catch inside this new user action and treat them accordingly.

If you feel that you need the try ... catch block, you can explain your reasoning here:  http://www.outsystems.com/ideas/Idea_View.aspx?IdeaId=331

Best regards


Hi Vasanth,

You can put an error handler inside F2 to catch all exceptions and return from that action.

Cheers,
Tiago Simões
Hi Tiago,  Is there a way to identify the source task or element which is causing the exception,  
You can identify the type of the exception that was raised, and you can define your own exception types, so that you can then track your own exceptions (in your own actions) and treat them in the appropriate way. You can access the exception message (via the Session.ExceptionMessage), and you can customize these messages in the exceptions that you raise. You cannot pinpoint exactly the elements that raised the exception unless you would have a try..catch block for each element, or if you are raising these exceptions yourself (thus knowing exactly where those user exceptions came from by type or even using the message for trace information). 

Hope this helped.

Hi Vasanth,

You can use the debugger option Break On All Errors. If you need to know it at runtime you need to check the Session.ExceptionMessage variable.

Cheers,
Tiago Simões