...

Package errors

import "github.com/letsencrypt/boulder/errors"
Overview
Index

Overview ▾

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.

Index ▾

func AlreadyRevokedError(msg string, args ...interface{}) error
func BadCSRError(msg string, args ...interface{}) error
func BadPublicKeyError(msg string, args ...interface{}) error
func BadRevocationReasonError(reason int64) error
func CAAError(msg string, args ...interface{}) error
func ConnectionFailureError(msg string, args ...interface{}) error
func DNSError(msg string, args ...interface{}) error
func DuplicateCertificateError(retryAfter time.Duration, msg string, args ...interface{}) error
func DuplicateError(msg string, args ...interface{}) error
func FailedValidationError(retryAfter time.Duration, msg string, args ...interface{}) error
func InternalServerError(msg string, args ...interface{}) error
func InvalidEmailError(msg string, args ...interface{}) error
func MalformedError(msg string, args ...interface{}) error
func MissingSCTsError(msg string, args ...interface{}) error
func New(errType ErrorType, msg string, args ...interface{}) error
func NotFoundError(msg string, args ...interface{}) error
func OrderNotReadyError(msg string, args ...interface{}) error
func RateLimitError(retryAfter time.Duration, msg string, args ...interface{}) error
func RegistrationsPerIPError(retryAfter time.Duration, msg string, args ...interface{}) error
func RejectedIdentifierError(msg string, args ...interface{}) error
func UnauthorizedError(msg string, args ...interface{}) error
func UnknownSerialError() error
func UnsupportedContactError(msg string, args ...interface{}) error
type BoulderError
    func (be *BoulderError) Error() string
    func (be *BoulderError) GRPCStatus() *status.Status
    func (be *BoulderError) Unwrap() error
    func (be *BoulderError) WithSubErrors(subErrs []SubBoulderError) *BoulderError
type ErrorType
    func (ErrorType) Error() string
type SubBoulderError

Package files

errors.go

func AlreadyRevokedError

func AlreadyRevokedError(msg string, args ...interface{}) error

func BadCSRError

func BadCSRError(msg string, args ...interface{}) error

func BadPublicKeyError

func BadPublicKeyError(msg string, args ...interface{}) error

func BadRevocationReasonError

func BadRevocationReasonError(reason int64) error

func CAAError

func CAAError(msg string, args ...interface{}) error

func ConnectionFailureError

func ConnectionFailureError(msg string, args ...interface{}) error

func DNSError

func DNSError(msg string, args ...interface{}) error

func DuplicateCertificateError

func DuplicateCertificateError(retryAfter time.Duration, msg string, args ...interface{}) error

func DuplicateError

func DuplicateError(msg string, args ...interface{}) error

func FailedValidationError

func FailedValidationError(retryAfter time.Duration, msg string, args ...interface{}) error

func InternalServerError

func InternalServerError(msg string, args ...interface{}) error

func InvalidEmailError

func InvalidEmailError(msg string, args ...interface{}) error

func MalformedError

func MalformedError(msg string, args ...interface{}) error

func MissingSCTsError

func MissingSCTsError(msg string, args ...interface{}) error

func New

func New(errType ErrorType, msg string, args ...interface{}) error

New is a convenience function for creating a new BoulderError

func NotFoundError

func NotFoundError(msg string, args ...interface{}) error

func OrderNotReadyError

func OrderNotReadyError(msg string, args ...interface{}) error

func RateLimitError

func RateLimitError(retryAfter time.Duration, msg string, args ...interface{}) error

func RegistrationsPerIPError

func RegistrationsPerIPError(retryAfter time.Duration, msg string, args ...interface{}) error

func RejectedIdentifierError

func RejectedIdentifierError(msg string, args ...interface{}) error

func UnauthorizedError

func UnauthorizedError(msg string, args ...interface{}) error

func UnknownSerialError

func UnknownSerialError() error

func UnsupportedContactError

func UnsupportedContactError(msg string, args ...interface{}) error

type BoulderError

BoulderError represents internal Boulder errors

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
}

func (*BoulderError) Error

func (be *BoulderError) Error() string

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

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

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.

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
    Unauthorized
    NotFound
    RateLimit
    RejectedIdentifier
    InvalidEmail
    ConnectionFailure

    CAA
    MissingSCTs
    Duplicate
    OrderNotReady
    DNS
    BadPublicKey
    BadCSR
    AlreadyRevoked
    BadRevocationReason
    UnsupportedContact
    // The requesteed serial number does not exist in the `serials` table.
    UnknownSerial
)

func (ErrorType) Error

func (ErrorType) Error() string

type SubBoulderError

SubBoulderError represents sub-errors specific to an identifier that are related to a top-level internal Boulder error.

type SubBoulderError struct {
    *BoulderError
    Identifier identifier.ACMEIdentifier
}