diff --git a/pkg/plug/server.go b/pkg/plug/server.go index e29fc7a..5fb1a57 100644 --- a/pkg/plug/server.go +++ b/pkg/plug/server.go @@ -50,11 +50,16 @@ func (p *Plug) Listen() error { var err error var source models.Source - noDataFoundError := otterError.Database{Reason: otterError.NoDataFound} + newDBerr := func() error { + return &otterError.Database{Reason: otterError.NoDataFound} + } + + noDataFoundError := newDBerr() 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 {