Previous topic

error

Next topic

eval

This Page

error_createΒΆ

error_create creates an error object.

e = error_create(domain, code, message)

Return Value

e is an error object.

Parameters

domain

domain is the group the error belongs to e.g. “file-error”.

code

code is the error number. The error number is only valid within a group.

message

message is the error message (string).

Comment

The 3 variables of the error object can be accessed using period (.) - the object member-selection expression e.g. e.message = "file not found";.

Example

def test()
{
    o = obj_create();
    e = o.load("d:/laksjdlksajd")
    if (e) {
        MessageBoxError(e.message);
        return e;
    }
    return 0;
}

id-1376826