Error on plugin action timeout

60 views
Skip to first unread message

joaomgcd

unread,
May 27, 2016, 6:57:57 AM5/27/16
to Tasker - Developers
Hi Pent.

Would it be possible to make a plugin action return an error on %err and %errmsg if it times out?
I can do this myself but it's a bit bad because:
  • I need to implement it manually in all my plugin actions
  • I need to set my internal timeout to Tasker's timeout minus a few seconds because I don't know how much time passes between Tasker calls the plugin and my code actually runs and my plugin needs to return the timeout error message before the Tasker action actually times out or no error message will be set
All in all it's a bit hacky and doesn't work that well, specially if the timeout is a small value like 5 seconds or so.

Any way you could add this? :)

Thanks again for everything
João

joaomgcd

unread,
May 27, 2016, 7:30:22 AM5/27/16
to Tasker - Developers
Oh, and on a related note: would it be possible for Tasker to clear the %err and %errmsg variables every time a new plugin action runs? It's cumbersome for users to always have to clear them manually after they check their values. Thanks again!

Crafty Apps Support

unread,
May 28, 2016, 2:37:54 AM5/28/16
to task...@googlegroups.com

> Oh, and on a related note: would it be possible for Tasker to clear
> the %err and %errmsg variables every time a new plugin action runs?
> It's cumbersome for users to always have to clear them manually after
> they check their values. Thanks again!

%err is set after every action, so there's no need to clear it.

Will clear %errmsg.

Pent

João Dias

unread,
May 28, 2016, 11:24:12 AM5/28/16
to task...@googlegroups.com
Thank you very much :)

And how about setting a message in the error variables when there's a timeout?

Thanks again
João



--
You received this message because you are subscribed to the Google Groups "Tasker - Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taskerdev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Crafty Apps Support

unread,
May 29, 2016, 3:52:50 AM5/29/16
to task...@googlegroups.com

>
> And how about setting a message in the error variables when there's a
> timeout?

Still pondering.

Pent

João Dias

unread,
May 29, 2016, 9:23:53 AM5/29/16
to task...@googlegroups.com
Thanks



Pent

Jim Becker

unread,
May 30, 2016, 10:27:48 AM5/30/16
to Tasker - Developers
Please leave %errmsg Asia is now. I set %errmsg to OK at the beginning of a task and then check if %errmsg is not OK after each plugin action. This way the logic can recover from some known errors. If %errmsg were reset each plugin action then I would have to set %errmsg to OK before each plugin action. The current setup lets users check the variable of choice, where %err is rest each time and %errmsg is not.

Pent

unread,
May 30, 2016, 11:29:28 AM5/30/16
to Tasker - Developers

Please leave %errmsg Asia is now. I set %errmsg to OK at the beginning of a task and then check if %errmsg is not OK after each plugin action. This way the logic can recover from some known errors. If %errmsg were reset each plugin action then I would have to set %errmsg to OK before each plugin action.

Sorry, I don't get why you need to set it yourself ? If Tasker is clearing it before each plugin action,
you can you just check after each plugin action if it's set (= error) or not.
 
The current setup lets users check the variable of choice, where %err is rest each time and %errmsg is not.

That's something I don't like, it's inconsistent and confusing if you're not aware of it. There's should be no %errmsg if there's no error.

Pent

João Dias

unread,
May 30, 2016, 11:31:14 AM5/30/16
to task...@googlegroups.com
I have to agree with Pent. Why set a value in an error variable if there's no error?

--

Pent

unread,
May 31, 2016, 1:43:29 AM5/31/16
to Tasker - Developers
I thought about this some more :-)

The disadvantages of changing how %errmsg is currently set are:

1) breaking existing tasks
2) if I later start using %errmsg for builtin Tasker actions, can't do error handling like:

ACTION
If %err = 1
Flash, Error: %errmsg
...
Else
...

Joao, your request (above) for this assumed that %err needed to be set by the user before each plugin action.
That's not the case, so they also don't need to clear %errmsg before each plugin action
as long as they use %err as the primary 'has there been an error' decider, before
consulting %errmsg. Which is the intended usage anyway.

Therefore, currently, I will not be changing how %errmsg is handled and will update docs
to make it clear that %errmsg refers to the last time %err was set.

Pent

Pent

unread,
May 31, 2016, 2:36:45 AM5/31/16
to Tasker - Developers
I implemented the timeout error setting, code is 2 and msg is 'timeout'.

Pent

João Dias

unread,
May 31, 2016, 8:24:20 AM5/31/16
to task...@googlegroups.com
Awesome :D

Thank you very much, that'll really help :)
The timeout error specifically will make a lot of people happy.

Thanks again!

João

On Tue, May 31, 2016 at 7:36 AM, Pent <crafty...@gmail.com> wrote:
I implemented the timeout error setting, code is 2 and msg is 'timeout'.

Pent

--

Pent

unread,
Jun 1, 2016, 3:16:03 AM6/1/16
to Tasker - Developers
I posted u5 as a prerelease on the support forum, could you give it a whirl ?

Thanks,

Pent

João Dias

unread,
Jun 2, 2016, 9:01:47 AM6/2/16
to task...@googlegroups.com
Ok, I'll try it now, thanks!

--
Reply all
Reply to author
Forward
0 new messages