lib/utils/promiseUtils/try.js
function promiseTry(callback) {
  try {
    const maybePromise = callback();

    if (isPromise(maybePromise)) {
      return maybePromise;
    } else {
      return Promise.resolve(maybePromise);
    }
  } catch (err) {
    return Promise.reject(err);
  }
}
function promiseTry(callback) {
  try {
    const maybePromise = callback();

    if (isPromise(maybePromise)) {
      return maybePromise;
    } else {
      return Promise.resolve(maybePromise);
    }
  } catch (err) {
    return Promise.reject(err);
  }
}
function promiseTry ( callback ) { try { const maybePromise = callback ( ) ; if ( isPromise ( maybePromise ) ) { return maybePromise ; } else { return Promise . resolve ( maybePromise ) ; } } catch ( err ) { return Promise . reject ( err ) ; } }
Works like Bluebird.try.
Works like Bluebird . try .