aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/letsencrypt/boulder/errors/errors.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-09 15:08:46 +0200
committerGitHub <noreply@github.com>2022-09-09 15:08:46 +0200
commit04270a080d4a06e671da9d2d7e6e15f6108338d9 (patch)
tree49116c6281fc4ab6cfac6bb5c9fb9600cdcd4573 /vendor/github.com/letsencrypt/boulder/errors/errors.go
parent8a2ab7c387928782d8a1893c99974638054a0ad0 (diff)
parent8e1aa7af3a3d4fac1aefa94ed4a4455ac190ead9 (diff)
downloadpodman-04270a080d4a06e671da9d2d7e6e15f6108338d9.tar.gz
podman-04270a080d4a06e671da9d2d7e6e15f6108338d9.tar.bz2
podman-04270a080d4a06e671da9d2d7e6e15f6108338d9.zip
Merge pull request #15695 from Luap99/update-buildah
Update buildah and c/common to latest
Diffstat (limited to 'vendor/github.com/letsencrypt/boulder/errors/errors.go')
-rw-r--r--vendor/github.com/letsencrypt/boulder/errors/errors.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/github.com/letsencrypt/boulder/errors/errors.go b/vendor/github.com/letsencrypt/boulder/errors/errors.go
index 3ca9988a6..861d54ad1 100644
--- a/vendor/github.com/letsencrypt/boulder/errors/errors.go
+++ b/vendor/github.com/letsencrypt/boulder/errors/errors.go
@@ -1,3 +1,13 @@
+// Package errors provides internal-facing error types for use in Boulder. Many
+// of these are transformed directly into Problem Details documents by the WFE.
+// Some, like NotFound, may be handled internally. We avoid using Problem
+// Details documents as part of our internal error system to avoid layering
+// confusions.
+//
+// These errors are specifically for use in errors that cross RPC boundaries.
+// An error type that does not need to be passed through an RPC can use a plain
+// Go type locally. Our gRPC code is aware of these error types and will
+// serialize and deserialize them automatically.
package errors
import (
@@ -12,7 +22,10 @@ import (
// BoulderError wrapping one of these types.
type ErrorType int
+// These numeric constants are used when sending berrors through gRPC.
const (
+ // InternalServer is deprecated. Instead, pass a plain Go error. That will get
+ // turned into a probs.InternalServerError by the WFE.
InternalServer ErrorType = iota
_
Malformed
@@ -101,6 +114,20 @@ func RateLimitError(msg string, args ...interface{}) error {
}
}
+func DuplicateCertificateError(msg string, args ...interface{}) error {
+ return &BoulderError{
+ Type: RateLimit,
+ Detail: fmt.Sprintf(msg+": see https://letsencrypt.org/docs/duplicate-certificate-limit/", args...),
+ }
+}
+
+func FailedValidationError(msg string, args ...interface{}) error {
+ return &BoulderError{
+ Type: RateLimit,
+ Detail: fmt.Sprintf(msg+": see https://letsencrypt.org/docs/failed-validation-limit/", args...),
+ }
+}
+
func RejectedIdentifierError(msg string, args ...interface{}) error {
return New(RejectedIdentifier, msg, args...)
}