From 636a1fc878398fa021f3b61195dab47515b5e2ae Mon Sep 17 00:00:00 2001 From: Roland Bracewell Shoemaker Date: Wed, 3 May 2017 22:18:13 +0000 Subject: [PATCH] Remove core.XXXError type checks --- cmd/orphan-finder/main.go | 4 +--- wfe/wfe.go | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/orphan-finder/main.go b/cmd/orphan-finder/main.go index 358dbdd50..875a36064 100644 --- a/cmd/orphan-finder/main.go +++ b/cmd/orphan-finder/main.go @@ -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) diff --git a/wfe/wfe.go b/wfe/wfe.go index 355a76b04..1dd730bae 100644 --- a/wfe/wfe.go +++ b/wfe/wfe.go @@ -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) }