code: function(errOrMessage, result) {
          var err = (errOrMessage instanceof Error) ? errOrMessage : new Error(errOrMessage);
          result = result || {};
          result.error = err;
          result.status = 'error';
          err.result = result;
          return err;
      }
docs: Generates a standardised Error object
  @param  {Error|String} errOrMessage
  @param  {Object} result
  @return {Error}