Skip to content

format

typescript
Exception.name

class: Exception

description

The specified name of the exception type, used to differentiate whether the thrown exception is of the specified type.

parameter

param_nametypedescription

reture

typedescription
stringThe name of the exception type.

code example

javascript
function Test() {
    try {
        throw new Exception("Exception test.");
    } catch (error) {
        Debug.log(error);

        let exp = error as Exception;
        if (exp.name != Exception.name) {
            Debug.log("Is a 'Exception' type error");
        }
    }
}