code: function isError(val, prop) {
      if (!isValue(val) || !isObject(val))
          return false;
      var type = constant_1.toStr.call(val).toLowerCase();
      return type === '[object error]' || type === '[object domexception]' || !isEmpty(val[prop]);
  }
docs: Is Error
  Checks if value is an error. Allows custom error property
  which can be useful in certain scenarios to flag an object
  as an error.
  
  @param val the value/object to be inspected.
  @param prop a custom property to check if exists indicating is error.