ObjectScript supports try/catch statements. Old code would have to resort to using the $ETRAP system variable, as in:

    new $etrap
    set $etrap = "do somethingElse()"

    // Execute "do somethingElse()" if "do something()" throws an exception
    do something()

This should be replaced with:

    try {
        do something()
    } catch (e) {
        // Perform something with e if needed
        do somethingElse()
    }

See here for more information.