Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
fix parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mfuentesg committed Jun 14, 2022
1 parent bbd121d commit 5d98cef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions storage/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func (sq *SQLite) Put(r storage.Record) (string, error) {
var id string
err := sq.db.QueryRow(query, r.Domain, r.IPv4, r.IPv6, r.TTL, r.Type).Scan(&id)

errCode := err.(*sqlite.Error).Code()
if errCode == ErrCodeConstraintUnique {
if sqlErr, ok := err.(*sqlite.Error); ok && sqlErr.Code() == ErrCodeConstraintUnique {
return "", storage.ErrRecordAlreadyExists
}
return id, err
Expand Down

0 comments on commit 5d98cef

Please sign in to comment.