dist/lib/driver.js
function cacheCall(method, key) {
    return methodCache.call(method, key)
        .catch((err) => {
        log_1.logger.error(`[${method}] Error:`, err);
        throw err; // throw after log to stop async chain
    })
        .then((result) => {
        (result)
            ? log_1.logger.debug(`[${method}] Success: ${JSON.stringify(result)}`)
            : log_1.logger.debug(`[${method}] Success`);
        return result;
    });
}
function cacheCall(method, key) {
    return methodCache.call(method, key)
        .catch((err) => {
        log_1.logger.error(`[${method}] Error:`, err);
        throw err; // throw after log to stop async chain
    })
        .then((result) => {
        (result)
            ? log_1.logger.debug(`[${method}] Success: ${JSON.stringify(result)}`)
            : log_1.logger.debug(`[${method}] Success`);
        return result;
    });
}
function cacheCall ( method , key ) { return methodCache . call ( method , key ) . catch ( ( err ) => { log_1 . logger . error ( ` ${ method } ` , err ) ; throw err ; // throw after log to stop async chain } ) . then ( ( result ) => { ( result ) ? log_1 . logger . debug ( ` ${ method } ${ JSON . stringify ( result ) } ` ) : log_1 . logger . debug ( ` ${ method } ` ) ; return result ; } ) ; }
Wraps Asteroid method calls, passed through method cache if cache is valid.
@param method The Rocket.Chat server method, to call through Asteroid
@param key Single string parameters only, required to use as cache key
Wraps Asteroid method calls passed through method cache if cache is valid .