don't confuse autocert

This commit is contained in:
Cadey Ratio 2017-04-28 22:36:11 -07:00
parent 8ad2a641f1
commit 316daa1eda
1 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package database
import (
"github.com/asdine/storm"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/net/context"
)
@ -34,7 +35,16 @@ type storageManager struct {
}
func (s *storageManager) Get(ctx context.Context, key string) ([]byte, error) {
return s.GetCert(ctx, key)
data, err := s.GetCert(ctx, key)
if err != nil {
if err == storm.ErrNotFound {
return nil, autocert.ErrCacheMiss
} else {
return nil, err
}
}
return data, nil
}
func (s *storageManager) Put(ctx context.Context, key string, data []byte) error {