// AddAndroidError record counts of error Android push notification.
518457
func (s *Storage) AddAndroidError(count int64) {
	total := s.GetAndroidError() + count
	s.setBadger(storage.AndroidErrorKey, total)
}
423640
func (s *Storage) GetAndroidError() int64 {
	count := atomic.LoadInt64(&s.stat.Android.PushError)

	return count
}
1072104
func (v *ValidationError) Add(err error) {
	if err != nil {
		v.Errors = append(v.Errors, err)
	}
}
1272963
func AddError(ch *Changeset, field string, message string) {
	ch.errors = append(ch.errors, errors.New(message, field, errors.Changeset))
}
389572
func (s *Storage) AddIosError(count int64) {
	atomic.AddInt64(&s.stat.Ios.PushError, count)
}
784776
func (stack *ErrorStack) PushAndDescribe(message string, err error) bool {
	if err != nil {
		stack.errors = append(stack.errors, fmt.Errorf(message+" %s", err.Error()))
		return true
	}
	return false
}
1256845
func (pn *PushNotification) AddPayload(p *Payload) {
	// This deserves some explanation.
	//
	// Setting an exported field of type int to 0
	// triggers the omitempty behavior if you've set it.
	// Since the badge is optional, we should omit it if
	// it's not set. However, we want to include it if the
	// value is 0, so there's a hack in push_notification.go
	// that exploits the fact that Apple treats -1 for a
	// badge value as though it were 0 (i.e. it clears the
	// badge but doesn't stop the notification from going
	// through successfully.)
	//
	// Still a hack though :)
	if p.Badge == 0 {
		p.Badge = -1
	}
	pn.Set("aps", p)
}
1326559
func (s *Storage) AddAndroidSuccess(count int64) {
	total := s.GetAndroidSuccess() + count
	s.setBuntDB(storage.AndroidSuccessKey, total)
}
71880
func SprintError(code, message, extra string, origErr error) string {
	msg := fmt.Sprintf("%s: %s", code, message)
	if extra != "" {
		msg = fmt.Sprintf("%s\n\t%s", msg, extra)
	}
	if origErr != nil {
		msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error())
	}
	return msg
}
735266
func (ec *ErrorCollection) AddErrorCollection(errs *ErrorCollection) {
	ec.lock.Lock()
	defer ec.lock.Unlock()

	for _, err := range errs.Errors {
		ec.addError(err)
	}
}
1122425
func (c *Sender) AppendAndRepeatError(err error, repeat int) {
	c.appendAndRepeat(response{e: err}, repeat)
}
238640
func (v *Errors) Add(key string, msg string) {
	v.Lock.Lock()
	v.Errors[key] = append(v.Errors[key], msg)
	v.Lock.Unlock()
}
470817
func (ec *ErrorCollection) AddError(err error) {
	ec.lock.Lock()
	defer ec.lock.Unlock()

	ec.addError(err)
}
653264
func (v *ValidatorList) And(validator Validator) *ValidatorList {
	(*v) = append((*v), validator)
	return v
}
1148771
func (err *MultiError) Add(errOrNil error) {
	if err != nil && errOrNil != nil {
		*err = append(*err, errOrNil)
	}
}
695507
func (s *Storage) AddIosError(count int64) {
	total := s.GetIosError() + count
	redisClient.Set(storage.IosErrorKey, strconv.Itoa(int(total)), 0)
}
942936
func (s *Storage) GetAndroidSuccess() int64 {
	var count int64
	getLevelDB(storage.AndroidSuccessKey, &count)

	return count
}