Properly handle ErrNoAccount

Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
James Munnelly 2019-12-03 11:00:31 +00:00
parent 641fe0da7c
commit 9d28261da5

View File

@ -275,11 +275,7 @@ func (a *Acme) registerAccount(ctx context.Context, cl client.Interface) (*acmea
if err == nil {
return acc, nil
}
// return all errors except for 404 errors (which indicate the account
// is not yet registered)
acmeErr, ok := err.(*acmeapi.Error)
if !ok || (acmeErr.StatusCode != 400 && acmeErr.StatusCode != 404) {
if err != acmeapi.ErrNoAccount {
return nil, err
}