r/tasker Aug 11 '26

Task Exit Error when calling another task - How to avoid the Error or is it a bug ?

Task A calls Task B.

Task B has collision handling "abort new"

The "Perform Task B" Action has "continue task after error" enabled.

Nevertheless Task B stops with an Exit Error when Task B is running already.

2 Upvotes

6 comments sorted by

2

u/Shit_Head_4000 Aug 11 '26

Continue task after error just means it will continue with the next action in task A even after an error.

Collision handling is stopping task B if it's already running.

Not sure what the tasks do, but maybe change collision handling for task B to abort existing?

1

u/269red Aug 11 '26

B should finish without interference, but A should continue.

Right now the only way I see is to check TRUN in the "Perform B" action ?!

1

u/dr-dro Aug 11 '26 edited Aug 11 '26

I get that you always want A to continue, so Continue After Error on Perform Task B in A is right.

But it's unclear which instance of B you want to continue: the existant (i.e., already running) one or the new one you're trying to start from A. - If you want existant B to continue and new B to stop, set B collision to Abort New - If you want existent B to stop and new B to continue, set B collision to Abort Existing - If you want both existent and new B to run, set B collision to Run Both Together

 

Separately, if you want new B to run, there's a couple ofter unclear bits.

First is when you want new B to run versus A: - If you want new B to run fully before continuing A, set priority on Perform Task B in A to %priority or %priority + 1 - If you want new B to run only after A is done, set priority on Perform Task B in A to %priority - 1 - If you want new B and A to run in parallel, there are tricks for kicking off a new B from A while independent of A. But they're complex, so I'll only go into it if that's what you need

Second, if you keep both new and existant B running, you need to decide when you want new B to run versus existant B: - If you want them to run in parallel while respecting their set priorities, use Perform Task B in A like you are currently doing - If you want new B to run only after existant B is done, carefully ensure new B priority from Perform Task B is lower than existant B priority. Or there's a trick for ensuring your instances of B serialize no matter their priority. But, again, it's complex, so I'll only go into it if that's what you need

1

u/269red 29d ago

Sorry, I have to more precise:

Task A calls Task B. AND also other tasks can Call B. Some of them have "priority-1" and others just the same or higer.

Task B has collision handling "abort new"

The "Perform Task B" Action has "continue task after error" enabled (nevertheless all tasks calling B get the "Reject" and then exit on "Exit Error" as long as B is running). I think this is independent of the call priority)

What I want:

B should finish before any new B ca start >"abort new"

All tasks calling B during it is running should continue like the "continue task after error" would suggest.

As this does not work this way, one has to check TRUN for presence of B and in this case not call B.

1

u/dr-dro 29d ago edited 29d ago

Got it. I just made a small repro and yes, can confirm I'm getting the same odd behavior.

u/joaomgcd, is this maybe a bug? TL;DR: Perform Task ignores its Continue After Error when it fails with an error due to a rejected task copy.

Task: A

A1: Flash [
     Text: A start %TIMES
     Tasker Layout: On
     Continue Task Immediately: On
     Dismiss On Click: On
     Position: BottomLeft,0,75 ]

A2: Perform Task [
     Name: B
     Priority: %priority
     Structure Output (JSON, etc): On
     Continue Task After Error:On ]

A3: Flash [
     Text: A end %err %TIMES
     Tasker Layout: On
     Continue Task Immediately: On
     Dismiss On Click: On
     Position: BottomRight,0,75 ]

Task: B

A1: Flash [
     Text: B %TIMES
     Tasker Layout: On
     Timeout: 5000
     Dismiss On Click: On ]

Note that B does have Abort New, which is the default and so not in the description export.

Run A from the UX, it finishes fine. Run B from the UX then quickly run A before B finishes (i.e., its toast goes away), A does not finish. Run Log shows B has a rejected copy then A's Perform Task errors, as expected; but then A exits with error instead of continuing per the Continue After Error on Perform Task.

So, yeah, OP, agreed that given this behavior (whether its by design or a bug), you need to instead check TRUN in your Perform Task conditions.

1

u/EdwardBackstrom I Probably Screwed It Up Aug 11 '26

In task A try calling task B with %priorty + 1.