function isError(err) {
    return err instanceof Error || (err && typeof err.message === 'string');
  }
Check if argument is an instance of Error object or a duck-typed equivalent.

@private
@param {Object} err - object to check
@param {string} err.message - error message
@returns {boolean}