diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
| commit | efc9e73404efc108c69b4498acb312d760cf8e5d (patch) | |
| tree | a6522428a9b92ff52ff4d590b23067b22e4960d5 /vendor/google.golang.org/appengine/errors.go | |
| parent | 1f9284de04ae5c996e4218918822297280ede164 (diff) | |
Go mod tidy
Diffstat (limited to 'vendor/google.golang.org/appengine/errors.go')
| -rw-r--r-- | vendor/google.golang.org/appengine/errors.go | 46 | 
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/google.golang.org/appengine/errors.go b/vendor/google.golang.org/appengine/errors.go deleted file mode 100644 index 16d0772..0000000 --- a/vendor/google.golang.org/appengine/errors.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// This file provides error functions for common API failure modes. - -package appengine - -import ( -	"fmt" - -	"google.golang.org/appengine/internal" -) - -// IsOverQuota reports whether err represents an API call failure -// due to insufficient available quota. -func IsOverQuota(err error) bool { -	callErr, ok := err.(*internal.CallError) -	return ok && callErr.Code == 4 -} - -// MultiError is returned by batch operations when there are errors with -// particular elements. Errors will be in a one-to-one correspondence with -// the input elements; successful elements will have a nil entry. -type MultiError []error - -func (m MultiError) Error() string { -	s, n := "", 0 -	for _, e := range m { -		if e != nil { -			if n == 0 { -				s = e.Error() -			} -			n++ -		} -	} -	switch n { -	case 0: -		return "(0 errors)" -	case 1: -		return s -	case 2: -		return s + " (and 1 other error)" -	} -	return fmt.Sprintf("%s (and %d other errors)", s, n-1) -}  | 
