Search

 

Module: Editor

Version: 2.2.1 +

Type: String

Category: Document

 

Description

In a website, errors can occur for different reasons. It is possible that certain external input is incorrect, or that there is an internal cause, an error in the implementation in Futurama. In both cases, you want to prevent that these errors will be displayed in your website, to your visitors. The formulas 'ReadError' and 'CountErrors' can serve as tools to prevent this.
The formula 'CountErrors' can be used to detect whether errors have occured in the website. It returns the total number of errors that have occured while executing the Futurama session. 
After this, the formula 'ReadError' can be used, to display information about what went wrong. 

Parameters

Count_warnings:

Here you can choose between True or False. True if warnings are counted, False if errors are counted.

Reset_count:

Here you can choose between True or False. True means that the number is reset to 0 after a session has ended.

Example

Description

For this example we create a simple and obvious error in a Futurama implementation:
Create a DataTabe with a Row and Colum count of 2. Now create an Index Formula where you refer to the DataTable, and select Row 3. This will obviously result in an error.
Create a WebPage in which you refer to the Index formula. When you visit the website, it will result in an error. Now create the formula 'CountErrors' in your webpage. This formula will return the number of errors. Create a Navigator and refer to the CountErrors formula in the condition property. If the amount of errors is greater than 0, the navigator should redirect you to a diferent wegpage.

Values parameters

Count_warnings:

False

Reset_count:

False

Result

Open your ‘WebPage’ in a browser and see the result.

Note, make sure that the reference to the formulas ‘CountErrors’ and ‘ReadError’  are at the bottom of the Futurama object 'WebPage'. This is because the browser loads the Futurama objects from top to bottom.

Related Topics

- ReadError

Updated: 2013-06-19