// can error with one of the following: Unknown_Sender, Invalid_Key, ValidationError, GeneralError
186675
func (a *MandrillAPI) SenderTimeSeries(address string) ([]TimeSeries, error) {
	var response []TimeSeries
	if address == "" {
		return response, errors.New("address cannot be blank")
	}
	var params map[string]interface{} = make(map[string]interface{})
	params["address"] = address
	err := parseMandrillJson(a, senders_time_series_endpoint, params, &response)
	return response, err
}
1211002
func IsKeyEExistsError(err error) bool {

	res, ok := err.(*gomemcached.MCResponse)
	if ok && res.Status == gomemcached.KEY_EEXISTS {
		return true
	}

	return false
}
1180906
func ValidateKey(key string) error {
	if len(key) <= keyMaxLength && keyRegex.MatchString(key) {
		return nil
	}
	return fmt.Errorf("invalid key: %q", key)
}
480164
func IsNoAddressError(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*noAddress)
	return ok
}
1367893
func (r *multipleOfRule) Error(message string) *multipleOfRule {
	r.message = message
	return r
}
1176011
func (h *backupHandler) sendError(w http.ResponseWriter, err error) {
	err, status := common.ServerErrorAndStatus(err)
	if err := sendStatusAndJSON(w, status, err); err != nil {
		logger.Errorf("%v", err)
	}
}
858988
func (conn *Conn) sendError(err error, dest string, serial uint32) {
	var e *Error
	switch em := err.(type) {
	case Error:
		e = &em
	case *Error:
		e = em
	case DBusError:
		name, body := em.DBusError()
		e = NewError(name, body)
	default:
		e = MakeFailedError(err)
	}
	msg := new(Message)
	msg.Type = TypeError
	msg.serial = conn.getSerial()
	msg.Headers = make(map[HeaderField]Variant)
	if dest != "" {
		msg.Headers[FieldDestination] = MakeVariant(dest)
	}
	msg.Headers[FieldErrorName] = MakeVariant(e.Name)
	msg.Headers[FieldReplySerial] = MakeVariant(serial)
	msg.Body = e.Body
	if len(e.Body) > 0 {
		msg.Headers[FieldSignature] = MakeVariant(SignatureOf(e.Body...))
	}
	conn.sendMessage(msg)
}
966259
func IsKeyNotFoundError(err error) bool {
	statusErr, _ := err.(*errors.StatusError)

	if statusErr != nil && statusErr.Status().Code == http.StatusNotFound {
		return true
	}

	return false
}
551135
func SendError(w http.ResponseWriter, err error) {
	w.WriteHeader(http.StatusForbidden)
	fmt.Fprintf(w, "Access denied: %v\n", err)
}
938439
func (user *User) CanLurk(message ExistingPost) bool {
	return message.ID() > 0 && !utils.InSlice(user.ID(), message.NumericLurkers())
}
892208
func (a *MandrillAPI) SenderInfo(address string) (SenderInfo, error) {
	var response SenderInfo
	if address == "" {
		return response, errors.New("address cannot be blank")
	}
	var params map[string]interface{} = make(map[string]interface{})
	params["address"] = address
	err := parseMandrillJson(a, senders_info_endpoint, params, &response)
	return response, err
}
666878
func Can(action string, addr string, whitelist, blacklist *Permissions) bool {
	if !strings.Contains(addr, ":") {
		addr = addr + ":80"
	}
	host, strport, err := net.SplitHostPort(addr)

	if err != nil {
		return false
	}

	port, err := strconv.Atoi(strport)

	if err != nil {
		return false
	}

	return (whitelist == nil || whitelist.Can(action, host, port)) &&
		(blacklist == nil || !blacklist.Can(action, host, port))
}
76548
func IsKeyNoEntError(err error) bool {

	res, ok := err.(*gomemcached.MCResponse)
	if ok && res.Status == gomemcached.KEY_ENOENT {
		return true
	}

	return false
}
27540
func (e *globalErrHandler) SendError(err error) {
	if e.buildErrors != nil {
		select {
		case e.buildErrors <- err:
		default:
		}
		return
	}

	jww.ERROR.Println(err)
}
1208395
func (e *ErrDiskLimitTimeout) Error() string {
	return fmt.Sprintf("Disk limit timeout of %s reached; requested %d bytes and %d files, %d bytes and %d files available: %+v",
		e.timeout, e.requestedBytes, e.requestedFiles,
		e.availableBytes, e.availableFiles, e.err)
}
494635
func checkSender(sender *Sender) error {
	if sender.ApiKey == "" {
		return errors.New("the sender's API key must not be empty")
	}
	if sender.Http == nil {
		sender.Http = new(http.Client)
	}
	return nil
}
277731
func (v *LengthRule) Error(message string) *LengthRule {
	v.message = message
	return v
}