fix(current_sequence): no error if not found (#3740)

This commit is contained in:
Silvan
2022-05-31 13:50:51 +02:00
committed by GitHub
parent 81c0ca3337
commit 16c86149be
16 changed files with 79 additions and 202 deletions

View File

@@ -201,10 +201,7 @@ func prepareLatestSequence() (sq.SelectBuilder, func(*sql.Row) (*LatestSequence,
&seq.Sequence,
&seq.Timestamp,
)
if err != nil {
if errs.Is(err, sql.ErrNoRows) {
return nil, errors.ThrowNotFound(err, "QUERY-gmd9o", "Errors.CurrentSequence.NotFound")
}
if err != nil && !errs.Is(err, sql.ErrNoRows) {
return nil, errors.ThrowInternal(err, "QUERY-aAZ1D", "Errors.Internal")
}
return seq, nil