# Issues

This document documents some common usage issues, if you find an exception in using the latest version of OpenEX. Please submit it to

GitHub Issues (opens new window)

# Compile Error

Once your script compiles with an exception, you will see the console print the following information.

Here we take a script with syntax errors as an example.





 

include "system";

value a = 12;

system.print(b);
1
2
3
4
5

After OpenEX starts, the following results are output

Compile Error: Unable to resolve symbols.
    Token: b
    Line: 5
    Filename: script.exf
    Edition: OpenEX Pro
    Version: v0.1.4
Location:
    system.print(b);
                 ^
1
2
3
4
5
6
7
8
9

# Error table

The following is a comparison table of all compile errors

ID Name Description
need.lr.b '}' expected. Please check that the parentheses are complete
need.lp.b '{' expected. Please check that the parentheses are complete
need.lr.s '(' expected. Please check that the parentheses are complete
need.lp.s ')' expected. Please check that the parentheses are complete
need.sem.marks '"' expected. Please check that the quotation marks are complete
need.sem.call '.' expected. Check whether the function call statement is complete
need.statement.catch 'catch' expected. Check whether the try statement has the corresponding catch statement.
miss.function.body Missing function body. Functions have no defined body.
miss.statement.body Missing statement body. No such statement body.
type.not.valid Type name is not valid. Check whether the function or variable name is represented by the Identifier Type field
unable.resolve.symbols Unable to resolve symbols. Please check variables are defined or imported runtime library
not.statement Not a statement Please check statement is complete
illegal.expression.start Illegal start of expression. Please check expression is complete
illegal.expression.comb Illegal combination of expressions. Please check expression is correct
illegal.string.escape Illegal escape character in string literal. Please check escape characters in the string are correct
illegal.key Illegal keywords. An illegal keyword appears in the initial value of the variable
outside.function.return Return outside function. The return statement is defined outside the function body
outside.loop.back Back outside loop The return statement is defined outside the loop body

# Runtime Error

Usually this combination of error statements is legal and cannot be parsed by the front-end compiler. However, exceptions occur at runtime

Here we take a script with a runtime error as an example





 

include "system";

value ary = [1,2,3];

system.print(ary[3]);
1
2
3
4
5

After OpenEX starts, the following results are output

ScriptRuntimeError: Array index out of bounds,length(index:3),index(index:3)
	ThreadName: main
	FileName: main.exf
	Exception: INDEX_OUT_OF_BOUND_EXCEPTION
	Edition: OpenEX Pro
	Version: v0.1.2
Call stack struct:
	at <main.exf>: loader.boot(Script Loader)
	at <main.exf>: array.get_object(Runtime Function)
1
2
3
4
5
6
7
8
9

Runtime errors output a script call stack, typically enclosing the type of each stack frame

  • Script Loader Not create by user, which is a loader function used by the execution engine to execute user scripts
  • User Script A script function created by a user
  • Runtime Function Runtime implementation functions, not created by script users. Implemented by the runtime itself or by an external extension

# Error table

The following are all runtime exceptions

catch: Whether it can be handled by the 'try-catch' statement

Name Description catch
VM_ERROR An error occurred internally at runtime NO
VM_OP_STACK_ERROR An exception occurred on the operation stack of the stack frame NO
NULL_PRINT_EXCEPTION Null print exception YES
INDEX_OUT_OF_BOUNDS_EXCEPTION Index out of bounds exception YES
ILLEGAL_ACCESS_EXCEPTION Illegal parameter exception YES
FILE_IO_EXCEPTION File I/O operation exception YES
NO_SUCH_FUNCTION_EXCEPTION Not found function YES
TYPE_CAST_EXCEPTION An exception occurred in the type conversion YES
NO_SUCH_VALUE_ERROR Not found value NO

Tip

In the OpenEX Pro series, versions v0.1.1 and below have no exception error types and call stack output, and before they were replaced, the JVM call stack structure was printed directly.