Global exception handler (mark as SE and get next transaction)

Hello

I need some help

I want every time when there is an exception caught in global handler, the current transaction to be mark as system exception and the process to go in initialize state (where I close and then initialize all the apps). What I have to do in the global handler to do so?

1 Like

Hi @Denislav_Vladimirov,

I understood that you are working with REFramework.

Considering that, the template already does that and you don’t need to make any change. Also, you wouldn’t need a global exception handler.

If I misunderstood you or if you have to do something specific, please let me know.

If this solves your problem, kindly mark this post as solution to close this topic.

Thanks!

Hello Gustavo

Thank you for the answer

Yes I use REFramework. I started thinking of Global Handler when I get unexpected exception in my Catches(in Try Catch) and the process has been terminated. In Catches i close and then open all apps, but in this case one of the apps doesn’t started and the process has been terminated. Do you have any suggestions for this case?

1 Like

Hi @Denislav_Vladimirov,

Could you share your project if it does not contain private data or could you create an example that simulates the error you are facing and share it, please?

Thanks!

If I have Business exception in Invoke ProcessTransaction workflow then I try in Catches to handle with it (Usually this BE happened on AppScreen1 or AppScreen2). I check if I’m on AppScreen1 or AppScreen2 - then everything is good and I have process logic that handle with it. But if I’m not on AppScreen1 or AppScreen2 then I kill the app and launch it again and mark transaction as SE. But if I have an error(exception) in invoke iApplyLaunch workflow then the whole process has been terminated (this error happened very rare but it happen sometimes). And I want to mark the transaction as SE and go to Initialize State like if i didn’t try to catch.

1 Like

Hello @Denislav_Vladimirov,

I believe this solves your problem

Main.xaml (75.8 KB)

I just changed the Process Transaction state (Main.xaml)

Just one note…

You also need to change one argument:

Thank you for your time. In my project is the same. I don’t know what you want to modify. I will make try catch in the iApplyLaunch workflow and i hope it will be good.

1 Like

Hi @Denislav_Vladimirov,

Let me describe all changes I made:

  1. Main.xaml - Process Transaction state: Add an assign in the BusinessRuleException. I think in your case you are using SystemError, so keep SystemError instead of System Exception

  1. Main.xaml - Process Transaction state: Surrond you Check&CloseAppWindows sequence in the BusinessRuleException by a TryCatch

  1. Main.xaml - Process Transaction state: Add a new catch (System.eception) to this new TryCatch and inside of it add the assigns below. I Think in your case you are using SystemError, so keep SystemError instead of System Exception

  1. Mai9n.xaml- Process Transaction state: In the Invoke SetTransactionStatus of the BusinessRuleException, replace Nothing for the argument in_SystemError/in_SystemException by the variable SystemError/SystemException.

That’s it!

If this solves your problem, kindly mark this post as solution to close this topic.

If you need extra help and/or have any question, plese let me know :slight_smile:

Thanks!

1 Like

Thank you
I’ll try this :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.