pcall [function]

pcall( callable func[, callable errh ])

Calls the callable func, hiding internal errors from the caller or optionally passing them to callable errh.

include "string";

function handler( type, msg )
{
    if( string_find( msg, "not found" ) !== null )
        sys_msg( type, "nooooooooooo" );
}

function handler2( type, msg )
{
    if( string_find( msg, "not found" ) !== null )
        return SGS_ERROR;
}

pcall(function(){ print x; }); // nothing
pcall(function(){ print x; }, handler ); // renamed warning
pcall(function(){ print x; }, handler2 ); // changed type to error