function trythen( x, y ) {
	if ( !isFunction( x ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );
	}
	if ( !isFunction( y ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', y ) );
	}
	try {
		return x();
	} catch ( error ) {
		return y( error );
	}
}
If a function does not throw, returns the function return value; otherwise, returns the return value of a second function `y`.

@param {Function} x - function to try invoking
@param {Function} y - function to invoke if a function throws
@throws {TypeError} first argument must be a function
@returns {*} the return value of either `x` or `y`

@example
var randu = require( '@stdlib/random/base/randu' );

function x() {
    if ( randu() < 0.5 ) {
        throw new Error( 'beep' );
    }
    return 1.0;
}

function y() {
    return randu();
}

var z = trythen( x, y );
// returns <number>