diff --git a/persistence/utils.go b/persistence/utils.go index f0d374f..37846e8 100644 --- a/persistence/utils.go +++ b/persistence/utils.go @@ -1,6 +1,7 @@ package persistence import ( + "fmt" "errors" "os" "strings" @@ -8,6 +9,15 @@ import ( "offline_twitter/scraper" ) +var NotInDatabase = errors.New("Not in database") + +type ErrNotInDatabase struct { + Table string + Value interface{} +} +func (err ErrNotInDatabase) Error() string { + return fmt.Sprintf("Not in database: %s %q", err.Table, err.Value) +} // DUPE 1 func file_exists(path string) bool {