code: function wrap_sync(fn) {
    return function (params) {
      var val = fn(params);
      if (val && !isPromise(val)) throw val;
      return val;
    };
  }
docs: Wrap sync function handler, it can: - return nothing - throw - return Promise.