fix(import): check for no rows error (#487)

This commit is contained in:
Felipe Martin Garcia 2022-10-04 13:54:33 +02:00 committed by GitHub
parent 09f2465065
commit 460014581c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,8 @@
package cmd
import (
"database/sql"
"errors"
"fmt"
"os"
"strings"
@ -92,7 +94,7 @@ func importHandler(cmd *cobra.Command, args []string) {
}
_, exist, err := db.GetBookmark(cmd.Context(), 0, url)
if err != nil {
if err != nil && !errors.Is(err, sql.ErrNoRows) {
cError.Printf("Skip %s: Get Bookmark fail, %v", url, err)
return
}