49
Views
9
Comments
exception
Application Type
Reactive

I'm quite new to OutSystems, and I'm currently learning about exceptions and handlers. I've read through all the OutSystems documentation, but I'm finding this particular topic a bit confusing. I have two diagrams, and in one of them, the 'NotRegistered' handler is executing, while in the other one, the 'AllException' handler is executing. I'm really grateful for anyone who can help me understand the difference based on the diagrams. 



Screenshot 2023-10-17 161328.png
Screenshot 2023-10-17 160631.png

Hello,

When you throw, in the server action, the "Not CFO" exception, it will be immediately handled in the AllException within that server action. In the client action no exception will be caught since it was taken care inside the server action.

Have in mind that "Not CFO" is a "User Exception" so you can never catch it outside this module since User exceptions are not shareable.

The "Not Registered" handler you have in that client action will only be caught if you throw them explicitely. "Not Registered" means that you don't have a login. This can be managed in the Common Flow instead of a client action since you have to be registered to even reach that code.


Thank you for your prompt response. I'm a bit confused about why the "notregistered" handler is executed in the first diagram,  its explanation also states that the "notregistered" handler will be executed. In the first scenario,why Allexception" handler is being executed instead of the "notregistered" handler? Both diagrams appear identical, but there seem to be distinct scenarios, and I'm having trouble understanding the difference. Could u please explain both scenarios .

Hi @Amritha venkitachalam 

I'd be happy to help you understand the difference between the 'NotRegistered' handler and the 'AllException' handler in OutSystems. OutSystems is a low-code development platform that uses visual development to create web and mobile applications. In this context, exceptions and handlers are used to manage errors and unexpected situations in your applications.

'NotRegistered' Handler:

  1. This handler is specific to a particular exception or error that you've identified in your application.
  2. It is used when you want to handle a specific type of exception in a distinct way. You configure this handler to deal with a particular error scenario that you expect to happen.
  3. In your diagram, when the 'NotRegistered' handler is executing, it means that a particular expected error, which matches the criteria of this handler, has occurred in your application.
  4. You would use this type of handler when you know the exact error you want to address and want to define a specific response for it.

'AllException' Handler:

  1. This handler is more general and acts as a catch-all for any unhandled exceptions or errors in your application that don't match a specific 'NotRegistered' handler.
  2. When the 'AllException' handler is executing, it means that an error occurred for which there is no specific handler defined in your application. This handler can catch and deal with any unhandled exceptions.
  3. You would use this type of handler when you want to provide a common or generic error handling strategy for any unexpected errors that may occur.

To summarize, the key difference is in the specificity of the handlers:

  1. 'NotRegistered' handler is used for specific, expected exceptions.
  2. 'AllException' handler is used for general, unexpected exceptions that don't match any specific handlers.

Hope this will help you!!

Kind regards

Sourabh Sharma

@Sourabh sharma Thankyou for your response.Could you tell me the difference according to my diagrams.Both diagrams appear identical, but there seem to be distinct scenarios, and I'm having trouble understanding the difference. Could u please explain both scenarios which includes a client and server action.


Hi @Amritha venkitachalam ,

Do these images you share come out of some course you are following ??

At first glance, the first one (with image #10) is just blatantly wrong  It is not because at a higher level there is something more specific that the lower action will defer handling.

Closeness of the handler to the exception being thrown trumps specificity.

The explanation with #12 image seems entirely correct.

Discuss this with the person who wrote these pages, as he/she might want to revise the text.

Dorine


@Dorine Boudry Okay Thankyou so much for your help!

Hi @Amritha venkitachalam hope you're well

Judging specifically the two images you provided, seens to me that what's happening is:

  1. The diagrams on both images have no differences at all. They are both the same
  2. The explanation on the image containing figure #10 is wrong
  3. The explanation on the image containing figure #12 is correct. That's what'll happens if you throw the NotRegistered exception. It'll be handled on the CheckCFO flow, since it has a handler (the AllExceptions handler) that could do it. 
    It doens't matter if it's generic, as long as it's on the same branch or hierarchy as the exception thrown.

I think that's similar to what @Dorine Boudry is saying also.

Hope i could help a bit.


Best regards!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.