Documentation
¶
Overview ¶
Package errors provide a special error type for use in Boulder. This error type carries additional type information with it, and has two special powers:
1. It is recognized by our gRPC code, and the type metadata and detail string will cross gRPC boundaries intact.
2. It is recognized by our frontend API "rendering" code, and will be automatically converted to the corresponding urn:ietf:params:acme:error:... ACME Problem Document.
This means that a deeply-nested service (such as the SA) that wants to ensure that the ACME client sees a particular problem document (such as NotFound) can return a BoulderError and be sure that it will be propagated all the way to the client.
Note, however, that any additional context wrapped *around* the BoulderError (such as by fmt.Errorf("oops: %w")) will be lost when the error is converted into a problem document. Similarly, any type information wrapped *by* a BoulderError (such as a sql.ErrNoRows) is lost at the gRPC serialization boundary.
Index ¶
- func AccountDoesNotExistError(msg string, args ...any) error
- func AlreadyReplacedError(msg string, args ...any) error
- func AlreadyRevokedError(msg string, args ...any) error
- func BadCSRError(msg string, args ...any) error
- func BadNonceError(msg string, args ...any) error
- func BadPublicKeyError(msg string, args ...any) error
- func BadRevocationReasonError(reason int64) error
- func BadSignatureAlgorithmError(msg string, args ...any) error
- func CAAError(msg string, args ...any) error
- func CertificatesPerDomainError(retryAfter time.Duration, msg string, args ...any) error
- func CertificatesPerFQDNSetError(retryAfter time.Duration, msg string, args ...any) error
- func ConnectionFailureError(msg string, args ...any) error
- func DNSError(msg string, args ...any) error
- func DuplicateError(msg string, args ...any) error
- func FailedAuthorizationsPerDomainPerAccountError(retryAfter time.Duration, msg string, args ...any) error
- func InternalServerError(msg string, args ...any) error
- func InvalidEmailError(msg string, args ...any) error
- func InvalidProfileError(msg string, args ...any) error
- func LimitOverrideRequestsPerIPAddressError(retryAfter time.Duration, msg string, args ...any) error
- func MalformedError(msg string, args ...any) error
- func MissingSCTsError(msg string, args ...any) error
- func New(errType ErrorType, msg string) error
- func NewOrdersPerAccountError(retryAfter time.Duration, msg string, args ...any) error
- func NotFoundError(msg string, args ...any) error
- func OrderNotReadyError(msg string, args ...any) error
- func RateLimitError(retryAfter time.Duration, msg string, args ...any) error
- func RegistrationsPerIPAddressError(retryAfter time.Duration, msg string, args ...any) error
- func RegistrationsPerIPv6RangeError(retryAfter time.Duration, msg string, args ...any) error
- func RejectedIdentifierError(msg string, args ...any) error
- func UnauthorizedError(msg string, args ...any) error
- func UnknownSerialError() error
- func UnsupportedContactError(msg string, args ...any) error
- type BoulderError
- type ErrorType
- type SubBoulderError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlreadyReplacedError ¶
func AlreadyRevokedError ¶
func BadCSRError ¶
func BadNonceError ¶
func BadPublicKeyError ¶
func ConnectionFailureError ¶
func DuplicateError ¶
func InternalServerError ¶
func InvalidEmailError ¶
func InvalidProfileError ¶
func LimitOverrideRequestsPerIPAddressError ¶ added in v0.20250902.0
func MalformedError ¶
func MissingSCTsError ¶
func NotFoundError ¶
func OrderNotReadyError ¶
func RejectedIdentifierError ¶
func UnauthorizedError ¶
func UnknownSerialError ¶
func UnknownSerialError() error
func UnsupportedContactError ¶
Types ¶
type BoulderError ¶
type BoulderError struct {
Type ErrorType
Detail string
SubErrors []SubBoulderError
// RetryAfter the duration a client should wait before retrying the request
// which resulted in this error.
RetryAfter time.Duration
}
BoulderError represents internal Boulder errors
func (*BoulderError) Error ¶
func (be *BoulderError) Error() string
Error implements the error interface, returning a string representation of this error.
func (*BoulderError) GRPCStatus ¶
func (be *BoulderError) GRPCStatus() *status.Status
GRPCStatus implements the interface implicitly defined by gRPC's status.FromError, which uses this function to detect if the error produced by the gRPC server implementation code is a gRPC status.Status. Implementing this means that BoulderErrors serialized in gRPC response metadata can be accompanied by a gRPC status other than "UNKNOWN".
func (*BoulderError) Unwrap ¶
func (be *BoulderError) Unwrap() error
Unwrap implements the optional error-unwrapping interface. It returns the underlying type, all of when themselves implement the error interface, so that `if errors.Is(someError, berrors.Malformed)` works.
func (*BoulderError) WithSubErrors ¶
func (be *BoulderError) WithSubErrors(subErrs []SubBoulderError) *BoulderError
WithSubErrors returns a new BoulderError instance created by adding the provided subErrs to the existing BoulderError.
type ErrorType ¶
type ErrorType int
ErrorType provides a coarse category for BoulderErrors. Objects of type ErrorType should never be directly returned by other functions; instead use the methods below to create an appropriate BoulderError wrapping one of these types.
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 NotFound RateLimit RejectedIdentifier InvalidEmail ConnectionFailure CAA MissingSCTs Duplicate OrderNotReady DNS BadPublicKey BadCSR AlreadyRevoked BadRevocationReason UnsupportedContact // The requested serial number does not exist in the `serials` table. UnknownSerial Conflict // Defined in https://datatracker.ietf.org/doc/draft-aaron-acme-profiles/00/ InvalidProfile // The certificate being indicated for replacement already has a replacement // order. AlreadyReplaced BadSignatureAlgorithm AccountDoesNotExist BadNonce )
These numeric constants are used when sending berrors through gRPC.
type SubBoulderError ¶
type SubBoulderError struct {
*BoulderError
Identifier identifier.ACMEIdentifier
}
SubBoulderError represents sub-errors specific to an identifier that are related to a top-level internal Boulder error.