lib/capturejs.js
function reportStatus(status) {
        if (DEBUG && status !== "success") inspectArgs("reportStatus: ", status);

        if (status === "fail") {
            var err = `capturejs: cannot access ${option.uri}: failed to open page`;
            console.error(err);
            phInstance.exit();
            process.nextTick(callback, err);
        } else {
            return phPage;
        }
    }
function reportStatus(status) {
        if (DEBUG && status !== "success") inspectArgs("reportStatus: ", status);

        if (status === "fail") {
            var err = `capturejs: cannot access ${option.uri}: failed to open page`;
            console.error(err);
            phInstance.exit();
            process.nextTick(callback, err);
        } else {
            return phPage;
        }
    }
function reportStatus ( status ) { if ( DEBUG && status !== "success" ) inspectArgs ( "reportStatus: " , status ) ; if ( status === "fail" ) { var err = ` ${ option . uri } ` ; console . error ( err ) ; phInstance . exit ( ) ; process . nextTick ( callback , err ) ; } else { return phPage ; } }
Log status messages, and close PhantomJS on failure.
Log status messages and close PhantomJS on failure .