Error checking

Updated at:

The error checking feature in Mobi helps developers quickly find and fix errors during development. This improves development efficiency and code quality. This document explains how to use the error checking feature.

Features

The error checking feature in Mobi includes the following:

  • Automatic real-time checking: The error checking feature runs automatically in real time as you develop your application and provides immediate error messages.

  • Error message display: The error panel shows detailed information for each error, which makes it easy to correct them.

  • Error locating: Click an error message in the error panel to quickly navigate to the location of the error.

Error checking scope and error types

Checking scope

Error checking in Mobi covers the following areas:

  • Basic configuration checks

    1. Configuration integrity check: Checks whether required configuration items are completed.

    2. Configuration validity check:

      1. For expressions or code segments, a JavaScript syntax check is performed.

      2. For static fields, a validity check is performed. For example, the check verifies whether a color meets the hexadecimal standard or whether a timeout is a number.

  • Reference relationship detection

    1. Reference validity check: Checks whether referenced resources exist, such as components, integrated resources, image resources, and pages.

    2. Circular reference check: Checks for circular references among resources such as components, variables, and frontend functions. For example, a circular reference occurs if the text property of the component text1 is {{text2.text}}, and the text property of text2 is {{text1.text}}.

Error levels and types

Error check results in Mobi are divided into the following three levels based on their impact:

  • Error: This level of error causes runtime errors or prevents the application from running correctly.

  • Warning: This level of error might cause runtime errors.

  • Info: This level of error might indicate performance issues or other non-functional impacts.

Error-level issues are divided into the following categories:

  • Syntax error: An expression or code segment contains a JavaScript syntax error.

  • Circular reference error: A circular reference exists between referenced items.

  • Missing configuration item error: A required configuration item is missing.

  • Invalid reference: The referenced module or resource is invalid, or the reference cannot be resolved.

Using the error panel

Click the error notification area in the toolbar at the bottom of the editor to open the error panel.

All error messages are displayed in this panel. If there are many error messages, you can use the search and error level selection features in the panel to filter for specific error messages.

Click the error location information on the right side of an error entry to quickly navigate to where the error occurred.

Note

In the current version, errors in an application do not block the publishing process. However, Mobi strongly recommends that you fix all errors before you publish the application.