// GetAndroidError show error counts of Android notification.
421613
func (s *Storage) GetAndroidError() int64 {
	var count int64
	getLevelDB(storage.AndroidErrorKey, &count)

	return count
}
863327
func NewError(code int, message string) ServiceError {
	return ServiceError{Code: code, Message: message}
}
286359
func getSTSErrorResponse(err STSError, requestID string) STSErrorResponse {
	errRsp := STSErrorResponse{}
	errRsp.Error.Code = err.Code
	errRsp.Error.Message = err.Description
	errRsp.RequestID = requestID
	return errRsp
}
106709
func (s *Storage) GetAndroidSuccess() int64 {
	var count int64
	s.getBoltDB(storage.AndroidSuccessKey, &count)

	return count
}
629195
func LogErrorAndExit(err error, opts ...int) {
	var rc int
	if len(opts) > 0 {
		rc = opts[0]
	}
	if gLogLevel <= LError {
		logMessage("ERROR - ", err.Error())
	}
	os.Exit(rc)
}
1034535
func (c context) ReportError(err error, update *updater.Update, options updater.UpdateOptions) {
	if reportErr := c.reportError(err, update, options, defaultEndpoints.err, time.Minute); reportErr != nil {
		c.log.Warningf("Error notifying about an error: %s", reportErr)
	}
}
218705
func getError(data []byte) (err error) {
	rel := bytes.SplitN(data, []byte{'\x00'}, 2)
	if len(rel) != 2 {
		err = fmt.Errorf("Not a error data: %v", data)
		return
	}
	err = fmt.Errorf("%s: %s", rel[0], rel[1])
	return
}
888588
func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter, r *http.Request) {
	ctx := newContext(r, w, "GetBucketNotification")

	defer logger.AuditLog(w, r, "GetBucketNotification", mustGetClaimsFromToken(r))

	vars := mux.Vars(r)
	bucketName := vars["bucket"]

	objAPI := api.ObjectAPI()
	if objAPI == nil {
		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrServerNotInitialized), r.URL, guessIsBrowserReq(r))
		return
	}

	if !objAPI.IsNotificationSupported() {
		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrNotImplemented), r.URL, guessIsBrowserReq(r))
		return
	}

	if s3Error := checkRequestAuthType(ctx, r, policy.GetBucketNotificationAction, bucketName, ""); s3Error != ErrNone {
		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(s3Error), r.URL, guessIsBrowserReq(r))
		return
	}

	_, err := objAPI.GetBucketInfo(ctx, bucketName)
	if err != nil {
		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
		return
	}

	// Attempt to successfully load notification config.
	nConfig, err := readNotificationConfig(ctx, objAPI, bucketName)
	if err != nil {
		// Ignore errNoSuchNotifications to comply with AWS S3.
		if err != errNoSuchNotifications {
			writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
			return
		}

		nConfig = &event.Config{}
	}

	// If xml namespace is empty, set a default value before returning.
	if nConfig.XMLNS == "" {
		nConfig.XMLNS = "http://s3.amazonaws.com/doc/2006-03-01/"
	}

	notificationBytes, err := xml.Marshal(nConfig)
	if err != nil {
		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
		return
	}

	writeSuccessResponseXML(w, notificationBytes)
}
1325783
func GetErrorAllDescriptors() []ErrorDescriptor {
	result := []ErrorDescriptor{}

	for _, group := range GetGroupNames() {
		result = append(result, GetErrorCodeGroup(group)...)
	}
	sort.Sort(byValue(result))
	return result
}
708207
func (s *Storage) AddAndroidSuccess(count int64) {
	atomic.AddInt64(&s.stat.Android.PushSuccess, count)
}
1319199
func CheckIfError(err error) {
	if err == nil {
		return
	}

	fmt.Printf("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf("error: %s", err))
	os.Exit(1)
}
1203842
func (cs *Stats) GetError() error {
	cs.mutex.Lock()
	defer cs.mutex.Unlock()
	return cs.err
}
875333
func (s *Storage) GetIosError() int64 {
	count := atomic.LoadInt64(&s.stat.Ios.PushError)

	return count
}
476438
func (r Response) IsUserError() bool {
	return r.Err != nil && isUserError(r.Err)
}
1326559
func (s *Storage) AddAndroidSuccess(count int64) {
	total := s.GetAndroidSuccess() + count
	s.setBuntDB(storage.AndroidSuccessKey, total)
}
974867
func (s *Storage) GetAndroidError() int64 {
	var count int64
	s.getBoltDB(storage.AndroidErrorKey, &count)

	return count
}
187822
func sendAndExitIfError(err error, response *plugins.Response) {
	if err != nil {
		response.Errors = append(response.Errors, err.Error())
		sendAndExit(response)
	}
}