Skip to content
Error handling base...
 
Notifications
Clear all

Error handling based on filters

11 Posts
3 Users
0 Reactions
4 Views
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

Question!
I have an HTTP module that calls a Python script. The output from this script is a JSON file, which I then parse. However, sometimes a specific key contains an error, which I've defined. In such cases, I want the execution to go to a 'break' module. For instance, if a date has passed its validity period, but this isn't correctly reflected. Ideally, this would result in an incomplete execution with zero retries, allowing me to manually adjust it.

Another scenario: sometimes a key within the JSON is empty due to an inconsistency in the Python script. For these instances, I want to be able to filter them to a 'break' module with retries enabled.

I've attempted to add an error handler with such filters, but for some reason, when the error occurs, it doesn't proceed to the 'break' module.
Any help would be greatly appreciated!

 
Posted : 13/12/2024 11:31 am
Donald_Mitchell
(@donald_mitchell)
Posts: 36
Eminent Member
 

Hi,

What type of error are you encountering? Is it not possible to determine this during the scenario? Perhaps it requires human intervention?

Could we possibly review the module experiencing the error and the subsequent filters?

 
Posted : 13/12/2024 11:22 pm
Msquare_Automation
(@msquare_automation)
Posts: 88
Estimable Member
 

Please share a screenshot showing how you added the break and filter.

Regards,
Msquare Automation - Platinum Partner of callin.io

 
Posted : 14/12/2024 7:36 am
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

Just a text-based observation: if a value is empty or contains specific content, it's treated as an error.
Attached are 4 images. The output originates from the Parse JSON module, and I have a branch node configured with identical conditions to a test route originating from a router that leads to a Set Variable node. The branch node seems to ignore these conditions, while the Set Variable node processes them. I've noticed that the variables in the branch module's route are not fully highlighted in purple, which might be related. However, I'm unsure why this is happening. I then ran a scenario where the error condition was met, and as you can see, it correctly routes to the Set Variable node but not to the branch node...

 
Posted : 15/12/2024 9:53 am
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

Certainly!
Attached are 4 images. The output originates from the Parse JSON module, and I have a break attached with identical conditions to a test that comes from the router and goes to a set variable. The break module ignores it, but the set variable module processes it. I notice that the variables are not fully purple in the break module's route; could this be the cause? I'm unsure why this is happening. I then ran a scenario where the error occurred, and as you can see, it proceeds to the set variable module but not to the break module...

 
Posted : 15/12/2024 9:53 am
Donald_Mitchell
(@donald_mitchell)
Posts: 36
Eminent Member
 

I could be mistaken, but if module #281 fails to execute, it wouldn't have generated any output, meaning your variables couldn't be fully purple.

Could you confirm if the variables are not entirely purple within the break module route? Perhaps that's the cause?

 
Posted : 15/12/2024 9:43 pm
Msquare_Automation
(@msquare_automation)
Posts: 88
Estimable Member
 

Hello,

This mapping isn't generated by JSON for the error handler route. The 'break' action will only execute if the JSON parsing module encounters an error, and the filter is configured for an error message or error code, or if no filter is applied.

If a variable is missing, you'll need to either define an action or add an error handler to the module where you're using the input from JSON parsing, provided it's a required field. However, the error handler won't function in this specific scenario.

Regards,
Msquare Automation - Platinum Partner of callin.io

 
Posted : 16/12/2024 3:58 am
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

The "issue" is that it does execute correctly and consistently outputs a JSON. However, sometimes a specific JSON key is empty. In such scenarios, the process should fail (even if the module reports success) and retry until that key is populated.

 
Posted : 16/12/2024 7:57 am
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

I understand. Are there alternative methods to incorporate a break module? The requirement is simply to retry if a JSON key is empty. Otherwise, it would necessitate a large module, requiring me to copy everything that follows and paste it through a router to achieve the desired functionality. Is this the only available approach?

 
Posted : 16/12/2024 7:59 am
Msquare_Automation
(@msquare_automation)
Posts: 88
Estimable Member
 

Will it automatically retrieve the ID after some time? If so, what's the approximate waiting period?

Also, what are you mapping within the 'set variable' action?

Regards,
Msquare Automation - Platinum Partner of callin.io

 
Posted : 16/12/2024 8:33 am
Timo345
(@timo345)
Posts: 6
Active Member
Topic starter
 

No, it will require retrying the call for the Python script within the HTTP module. In such scenarios, I want it to proceed to a break point to allow for retries after 3-5 minutes. For other situations, I'll allow it to go to a break module without retries, as I need to manually input the key and address issues in our Python script.

 
Posted : 16/12/2024 8:47 am
Share: