fix: error handling

using pointer for noDataFoundError check in Listen method
This commit is contained in:
SoXX 2024-08-24 23:59:42 +02:00
parent 3129016364
commit 772ee38e0b

View File

@ -54,7 +54,7 @@ func (p *Plug) Listen() error {
source, err = database.GetSourceByDomain(p.ctx, p.source.Domain)
if err != nil {
if errors.Is(err, noDataFoundError) {
if errors.Is(err, &noDataFoundError) {
log.Printf("Initalizing source!")
source, err = database.CreateSource(p.ctx, p.source)
if err != nil {