Skip to main content
Solved

Error Handler: Throw - Configuring custom error types


Forum|alt.badge.img+1

I’m looking to generate distinct error categories via the “Error Handler - Throw” action (e.g. Business Exceptions vs System Exceptions). “Error handler - Throw” seems to be built for this use case - there’s a dropdown where we can select error type. However I can’t find any options in the product or on the docs pages about how to add/manage error types. There’s only one option available originally (AllErrors).

 

Best answer by Sam 5592

For custom error you need to use throw action. Within throw action you can put your custom business exception message and it will be caught by catch block( Currently AA support generic error handler) . It works fine. I hope it helps. You can have multiple try catch block and within try catch block you throw error. 

View original
Did this topic help answer your question?

12 replies

Forum|alt.badge.img+3
  • Navigator | Tier 3
  • 10 replies
  • March 31, 2023

I am looking for the same thing. @Micah.Smith Do you know if there is a way to create custom exception types? I looked in the package SDK and couldn't find anything there either. It would be awesome if there was a way to do this, especially when it comes to handling business exceptions. 


Forum|alt.badge.img+1

Hello, 
Is does any one got an answer for that? 
I am looking at it as well...


Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 10 replies
  • November 25, 2023

Anyone have an answer?


Forum|alt.badge.img+3
  • Navigator | Tier 3
  • 10 replies
  • March 22, 2024

So I found the way to do this. In the package.template file add the following 

 


Forum|alt.badge.img+3
  • Navigator | Tier 3
  • 10 replies
  • March 22, 2024

Sorta useless though since you can’t actually have multiple catch branches…. at least that is the way it appears to me. Would love for someone from AA support to actually confirm this.


Maria 4095
Forum|alt.badge.img+3
  • Cadet | Tier 2
  • 3 replies
  • September 19, 2024

Has anyone found an answer for this yet? 


Forum|alt.badge.img+1
  • Cadet | Tier 2
  • 2 replies
  • Answer
  • September 20, 2024

For custom error you need to use throw action. Within throw action you can put your custom business exception message and it will be caught by catch block( Currently AA support generic error handler) . It works fine. I hope it helps. You can have multiple try catch block and within try catch block you throw error. 


Forum|alt.badge.img
  • Cadet | Tier 2
  • 4 replies
  • December 24, 2024
V1Dylan wrote:

So I found the way to do this. In the package.template file add the following 

 

Thanks ​@V1Dylan , this is really helpful.

Out of interest, how did you know this? The SDK documentation doesn’t mention this: https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/developer/create-custom-exceptions.html

 

Thanks


Forum|alt.badge.img+1
  • Cadet | Tier 2
  • 1 reply
  • February 11, 2025

Hi ​@Adam Wilson.

Thank you for your help.

We’ve implemented the dropdown for catching different types of exceptions in the "Catch Error" command (Your method works!). However, even when we select our custom BusinessException, it still catches all types of exceptions instead of just the specified business exceptions.

Moreover, we are facing a preprocessing failure whenever we use multi-catch. Regardless of the type of exception being caught, the process fails as soon as there is more than one catch command.

This situation renders the current setup ineffective. I appreciate your assistance in resolving these issues.


Forum|alt.badge.img
  • Cadet | Tier 2
  • 4 replies
  • February 11, 2025

Hi ​@isamim ,

 

I was facing the same pre-processing error, so have had to deprecate our exceptions unfortunately.

Besides, I am unsure if this is supported as AA SDK documentation doesn’t specifically mention how to do this, and no other default packages in the control room have their own exceptions - so I am not sure how ​@V1Dylan came across this, but it’s certainly undocumented. 

 

Many thanks

Adam


Forum|alt.badge.img
  • Cadet | Tier 2
  • 4 replies
  • February 11, 2025

@Micah.Smith Hi,

 

Is there an official stance from AA on whether this type of custom exception implementation is supported with the package SDK? If so, is there any official documentation regarding this please?

Thanks!

Adam


Micah.Smith
Automation Anywhere Team
Forum|alt.badge.img+12
  • Automation Anywhere Team
  • 427 replies
  • February 12, 2025
Adam Wilson wrote:

@Micah.Smith Hi,

 

Is there an official stance from AA on whether this type of custom exception implementation is supported with the package SDK? If so, is there any official documentation regarding this please?

Thanks!

Adam

There’s documentation for creating custom bot command exceptions here:
https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/developer/create-custom-exceptions.html

We do not have any provision to throw any custom error and catch particular error


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings