Remove core.XXXError type checks
This commit is contained in:
parent
40663ba66c
commit
636a1fc878
|
|
@ -67,9 +67,7 @@ func checkDER(sai certificateStorage, der []byte) error {
|
|||
if err == nil {
|
||||
return errAlreadyExists
|
||||
}
|
||||
// TODO(#2600): Remove core.NotFoundError check once boulder/errors
|
||||
// code is deployed
|
||||
if _, ok := err.(core.NotFoundError); ok || berrors.Is(err, berrors.NotFound) {
|
||||
if berrors.Is(err, berrors.NotFound) {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Existing certificate lookup failed: %s", err)
|
||||
|
|
|
|||
|
|
@ -470,9 +470,7 @@ func (wfe *WebFrontEndImpl) verifyPOST(ctx context.Context, logEvent *requestEve
|
|||
// Special case: If no registration was found, but regCheck is false, use an
|
||||
// empty registration and the submitted key. The caller is expected to do some
|
||||
// validation on the returned key.
|
||||
// TODO(#2600): Remove core.NoSuchRegistrationError check once boulder/errors
|
||||
// code is deployed
|
||||
if _, ok := err.(core.NoSuchRegistrationError); (ok || berrors.Is(err, berrors.NotFound)) && !regCheck {
|
||||
if berrors.Is(err, berrors.NotFound) && !regCheck {
|
||||
// When looking up keys from the registrations DB, we can be confident they
|
||||
// are "good". But when we are verifying against any submitted key, we want
|
||||
// to check its quality before doing the verify.
|
||||
|
|
@ -486,9 +484,7 @@ func (wfe *WebFrontEndImpl) verifyPOST(ctx context.Context, logEvent *requestEve
|
|||
// For all other errors, or if regCheck is true, return error immediately.
|
||||
wfe.stats.Inc("Errors.UnableToGetRegistrationByKey", 1)
|
||||
logEvent.AddError("unable to fetch registration by the given JWK: %s", err)
|
||||
// TODO(#2600): Remove core.NoSuchRegistrationError check once boulder/errors
|
||||
// code is deployed
|
||||
if _, ok := err.(core.NoSuchRegistrationError); ok || berrors.Is(err, berrors.NotFound) {
|
||||
if berrors.Is(err, berrors.NotFound) {
|
||||
return nil, nil, reg, probs.Unauthorized(unknownKey)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue