How to handle exception?

How to handle exception?

Can anyone provide me demo application in outsystems?


On the learning part you have this video that goes through the subject and when you finish it you even have an hands on exercise.

You also have this documentation on the subject



Hi Harshali,

Exception handling in Outsystems is much similar to handling it in other technologies , In every action you can have a Exception flow which will get executed in case of any error in your code.

There are different type of exceptions , for ex. Database Exception , Security Exception , User Exceptions etc , these exceptions are specific type of exceptions to catch specific errors. There is also one All Exception which catches any type of exception.

Go  through this support document.



Hi Harshali , 

Please find the attached oml , i added two exception handler in SaveDetail action on CustomerDetails page . Within exception flow once the exception catches you can perform any logic to show meaningful exception message rather showing the one throw by the code.

I also added one Custom exception "MyCustomException"  in the exceptions and on RaiseCustomExceptionOnClick  action on CustomerDetails page . I raised this custom exception from my code and also have a handler to catch the same type of exception.

I hope this will give you a little idea to manage exceptions.



Just to complement the information in the previous comments, check also this page:

It gives a good example of the behaviours of the exception in the actions

Best regards

Carlos Lessa