Skip to main content

Errors

AR-0001 DIVIDE BY ZERO

Why ?

This error occurs if you are trying to divide a number by zero.

How to resolve it ?

You can resolve this error by first checking if the divisor is 0.

def int dividend = 20;
def int divisor = 0;

if (divisor != 0){
def int quotient = dividend / divisor;
}

CL-0001 EMPTY CLASS

Why ?

This error occurs if you have defined a new class with no fields.

How to resolve it ?

You should at least add one field to your class definition.

CL-0002 DUPLICATE FIELD IN CLASS

Why ?

This error occurs if two fields in your class definition have the exact same name.

How to resolve it ?

You should make sure that all the fields in your class have distinct unique names

CL-0003 DUPLICATE CLASS

Why ?

This error occurs when you are trying define a new class with a name that already exists as either an existing class name, an existing enum name or an existing variable.

How to resolve it ?

You should make sure that all variables, classes and enums have distinct unique names.

CL-0004 INVALID FIELD ACCESS

Why ?

This error occurs when you are trying to access a field in a class that does not exist in that class.

How to resolve it ?

Make sure that the fields you are trying to access are defined in the class.

def class Employee {
def string name;
def real salary;
def string dept;
}

def Employee employee = new Employee();

In the above example, you can only use fields name, salary and dept for the variable employee.

DA-0001 INVALID DATE

Why ?

This error occurs when you have provided a Date in invalid format.

How to resolve it ?

You should make sure that you are providing Date in the correct format. The default format for Date is YYYY-MM-DD.

DA-0002 INVALID TIME

Why ?

This error occurs when you have provided a Time in invalid format.

How to resolve it ?

You should make sure that you are providing Time in the correct format. The default format for Time is HH:mm:ss.

DA-0003 INVALID DATE TIME

Why ?

This error occurs when you have provided a DateTime in invalid format.

How to resolve it ?

You should make sure that you are providing DateTime in the correct format. The default format for DateTime is YYYY-MM-DDTHH:mm:ss.

EN-0001 EMPTY ENUM

Why ?

This error occurs if you have defined a new enum with no values.

How to resolve it ?

You should at least add one value to your enum definition.

EN-0002 DUPLICATE VALUE IN ENUM

This error occurs if two values in your enum definition have the exact same name.

How to resolve it ?

You should make sure that all the fields in your enum have distinct unique names.

EN-0003 DUPLICATE ENUM

Why ?

This error occurs when you are trying define a new enum with a name that already exists as either an existing class name, an existing enum name or an existing variable.

How to resolve it ?

You should make sure that all variables, classes and enums have distinct unique names.

EN-0004 INVALID ENUM VALUE ACCESS

This error occurs when you are trying to access a value in an enum that does not exist in that enum.

How to resolve it ?

Make sure that the value you are trying to access is defined in the enum.

def enum Department {
ENGINEERING("ENGINEERING"),
HR("HR"),
ACCOUNTING("ACCOUNTING"),
}

def Department department = Department.HR;

In the above example, you can only use values ENGINEERING, HR and ACCOUNTING for the variable department.

FN-0001 NON EXISTENT FUNCTION

Why ?

You are trying to call a function that does not exist.

How to resolve it ?

You can only call functions that have already been defined. Check Functions documentation for a list of all possible function names.

FN-0002 MISSING RETURN STATEMENT

Why ?

There's a return statement missing from your function.

How to resolve it ?

Certain functions require a compulsory return statement. Check Functions documentation for your specific function.

FN-0003 INVALID RETURN TYPE

The type of value that you are not return from your function is not allowed.

How to resolve it ?

Certain functions require a specific type of value to be returned. Check Functions documentation for your specific function.

FN-0004 INVALID NUMBER OF ARGUMENTS

The number of arguments that you are passing to your function does not match the expected number of arguments for that function.

How to resolve it ?

Each function requires a specific number of arguments. Check Functions documentation for your specific function.

FN-0005 INVALID TYPE OF ARGUMENT

The type of arguments that you are passing to your function does not match the expected type of arguments for that function.

How to resolve it ?

Each function requires specific types of arguments. Check Functions documentation for your specific function.

GE-0001 NULL POINTER EXCEPTION

Why ?

This error occurs if you are trying to operate (using an operator, calling a function or accessing a field) on a value that has null value (which means that it does not have any value).

How to resolve it ?

Make sure that the value you are trying to operate has a value. If the value can be null, wrap it inside a if statement

def real price = 20000.0;
def real discount; // discount has no value, therefore it is null

if (discount != null){ // make sure discount is not null
price = price - discount;
}

GE-0002 INVALID IDENTIFIER

Why ?

You have tried to use a variable that you have already defined.

How to resolve it ?

Make sure that any variable that you are using has already been defined or it will result in an error.

GE-0003 INVALID OPERAND TYPE

Why ?

You are trying to use an operator with an operand of invalid type.

How to resolve it ?

Each operator has a specific set of type of operands it can operate on. Check Operator documentation for your specific operator.

GE-0004 INVALID ELEMENT TYPE

Why ?

All elements in a List or Map should be of the same type.

How to resolve it ?

Make sure that all elements are of the same type. For example, List<string> can only have elements of string type. Map<string, int> can only have keys of type string and values of type int.

GE-0005 MAX ITERATION COUNTER REACHED

Why ?

This error occurs if your loop is running too many times. This might be because you may have made your loop run infinitely. Currently, the maximum number of times we allow the loop to be run is 10000 (This number might change in the future).

How to resolve it ?

Re-read your loop logic carefully. You might be running an infinite loop.

GE-0006 MISSING GENERICS

Why ?

This error occurs when you forget to specify generics for your List, Map or MapEntry types. Generics are the types that go inside the angular brackets <>.

How to resolve it ?

You should always provide generics for List, Map and MapEntry type. Check Types documentation for more details.

GE-0007 INVALID GENERICS

Why ?

This error occurs when you have wrong number of generics for your List, Map or MapEntry types. Generics are the types that go inside the angular brackets <>.

How to resolve it ?

You should provide correct number of generics for List, Map and MapEntry type. List requires 1 type and Map / MapEntry require two types.

GE-0008 INVALID TYPE

Why ?

This error occurs when you have provided wrong data type.

How to resolve it ?

The error message will give details about the expected type. Make sure you are providing the expected type.

IN-0001 INDEX OUT OF BOUNDS

Why ?

This happens when the index given for the List is outside the range.

How to resolve it ?

Index for a List type can only be from 1 to length of the list and their negative counterparts.

    def List<string> fruits= ["apple", "banana", "watermelon"];

In the above example, fruits has a length of 3. So the allowed indices are 1,2,3 and -1,-2,-3.

IN-0002 INVALID TYPE FOR INDEX

Why ?

This happens when the index given for the List is not an integer.

How to resolve it ?

Make sure that the index you have provided for a List is an integer value and it lies in the correct range.

RA-0001 INVALID RANGE

Why ?

This error occurs when the upper limit of range is lesser than the lower limit of the range.

How to resolve it ?

Make sure that the upper limit of your range is greater than equal to the lower limit.

    def List<string> range1= [1...5]; // This is correct
def List<string> range2= [5...1]; // This is wrong
// You can achieve the above by using reversed() function
def List<string> reversedRange = [1...5].reversed();

VA-0001 NON EXISTENT TYPE

Why ?

This error occurs when you are using a type that does not exist.

How to resolve it ?

Types can only be predefined types like string, int, real, boolean, Date, Time, DateTime, List, Map or MapEntry or they can be user defined types (classes and enums). See Types documentation and User-defined Types dcoumentation

VA-0002 DUPLICATE VARIABLE

Why ?

This error occurs when you are trying define a new variable with a name that already exists as either an existing class name, an existing enum name or an existing variable.

How to resolve it ?

You should make sure that all variables, classes and enums have distinct unique names.