Skip to content

Testing and debugging

mtwebit edited this page Feb 14, 2019 · 6 revisions

Developing and debugging

Always develop and test your code independently from Tasker until it is ready to be taskified.
Tasker should save every notices, errors etc. into $task->log_messages.
It even has an independent "debug" setting that controls this logging.
It also has its own exception, error and signal handlers to catch and handle as many errors as possible.

When you execute tasks using TaskerAdmin its Javascript frontend communicates with its backend API using JSON objects.
If you see "Parse errors" on this interface it means that the JSON object is not well formed, Tasker failed to execute your task (e.g. due to a syntax error). In this case you should reset the task manually (including resetting the running status to 0) and then check the raw results coming back from the API. To do this just add "api/" to the end of the TaskerAdmin URL (before the id and cmd arguments), and see what it produces.
Example:

https://example.org/processwire/page/tasks/api?id=60343&cmd=exec

It may display "PHP: Warning ...." or other messages.

Again: it is always a good idea to finalize your app before using Tasker to execute it.

Common problems

Mysql Server Has Gone Away

Check and increase wait_timeout in your MySQL config to match the execution time of your longest task.

Clone this wiki locally