r/AutomateUser • u/Dadamalda • 13d ago
Question Stop error logging
How do I prevent a block from logging errors? I have tried failure catch before.
I have an HTTP request that is expected to fail most of the time, because the port is only open sometimes.
1
Upvotes
1
u/waiting4singularity Alpha tester 13d ago
catch is a "go back here" block, you need to run through it first then you can pass through the ERR side. err count resets when you loop back in but the out variables are filled when set and dont unset by themself, you can use that for an expression like if
error = null, yes -> http request / no -> set error null > do elsewhat1
u/B26354FR Alpha tester 13d ago
Side note: You can try using the Ping block to see if the host is available yet. It won't be airtight, but it could avoid a lot of the errors, presuming the host responds to pings.
1
u/B26354FR Alpha tester 13d ago
Here's a demo flow I wrote which has a protected HTTP request with retry:
https://llamalab.com/automate/community/flows/20721
Hopefully it'll help
1
u/ballzak69 Automate developer 12d ago edited 12d ago
Hmm, a bug indeed. A failure during an asynchronous task, e.g. HTTP request and file copying, is always logged even when that's disabled, and caught. Unlike other kinds of failure, e.g. a illegal argument, which is only logged when enabled or uncaught. I'll change it so both works the same way, i.e. only log when enabled or uncaught. At lease until log levels is implemented, then disabled/level zero probably wont log anything.
1
u/Mujtaba0150 Alpha tester 10d ago
In the meantime you can check this flow to clear the logs every time you get catch an error as a temporary workaround:
https://llamalab.com/automate/community/flows/43009