Skip to content

Commit 4d6f531

Browse files
committed
improve error
1 parent d1acfeb commit 4d6f531

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

mtca/mtca.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"crypto/rand"
88
"crypto/sha256"
99
"crypto/x509"
10+
"database/sql"
1011
"encoding/asn1"
1112
"errors"
1213
"fmt"
@@ -431,6 +432,9 @@ func (m *mtca) latest(ctx context.Context) (*checkpoint, error) {
431432
m.mtcLogID(),
432433
m.mtcLogID())
433434
if err != nil {
435+
if errors.Is(err, sql.ErrNoRows) {
436+
return nil, fmt.Errorf("getting latest checkpoint for %q: issuance log DB is not initialized", m.mtcLogID())
437+
}
434438
return nil, fmt.Errorf("getting latest checkpoint for %q: %w", m.mtcLogID(), err)
435439
}
436440

0 commit comments

Comments
 (0)