Table of contents
Expand | ||||
---|---|---|---|---|
| ||||
|
...
Description
If an error occurs in any of the actions or the cube is exited along the red line, then the project execution will go to the block that is tied to the Bad End action. This is necessary in order to be able to set some additional actions in case of template termination with an error.
How to add an action to a project?
Through the context menu Add Action → Logic → BadEnd
...
Or use smart search .
What is it used for?
When the template is running, unexpected errors may occur, for example:
...
Returning data back to lists / tables for subsequent use without loss.
Logging errors
Adding invalid information to the Blacklist
Saving a backup
How to work with an action?
If the template ends with an error, the actions associated with Bad End will be performed:
...
Info |
---|
Bad End fires 1 time for each thread. |
...
Multiple run of the BadEnd at debugging
By default, when debugging, the project goes to Bad/GoodEnd only once. Then, you must restart the project with the “Restart” button.
To be able to run these actions multiple times during debugging, you have to enable the option Navigate to Bad / GoodEnd at multiple debugging in the program settings.
...
Usage example
Data recovery in case of error
For example, to work, we take a deleted string from the list. If in the process of work the template completed with any error, before we processed this line, then this data will be lost. To prevent this from happening, we use Bad End and add to it the action of adding a line to the back list. This way, if the operation fails, the raw data will be saved back to the list for later processing.
How can I track and fix the error?
Each step in the template has a unique identifier, by which it can be found in ProjectMaker. In order to get the id of a step with an error, in ZennoPoster logs, right-click by mistake and press " copy action id ":
...
Now, when an error occurs in the template, Bad End will create a log.txt file, which will record the time and ID of the error. If the identifier alone is not enough to fix the problem, you can add saving a screenshot of the instance , page source code and variable values . This will allow the most detailed restoration of the picture that led to the error, and make the necessary edits to normalize the project.
Adding invalid information to the Blacklist
You can create a list to store invalid information that leads to errors. For example, an incorrect username / password for an account. During the subsequent work of the template, check for the presence of data in the Blacklist and, if it matches, replace it.
...
Saving a backup
Save your work profile so that you don't lose it in the event of an error. And after fixing the problem, download it and continue working.
...