Call ErrorFunc on errors. Unexport DoRequestClient and DoRequestChrome

This commit is contained in:
Musab Gültekin
2019-12-13 00:03:44 +03:00
parent 7d2fe57bab
commit cfb16fe1ee
4 changed files with 16 additions and 8 deletions

View File

@@ -251,7 +251,11 @@ func (g *Geziyor) do(req *client.Request, callback func(g *Geziyor, r *client.Re
res, err := g.Client.DoRequest(req)
if err != nil {
log.Println(err)
if g.Opt.ErrorFunc != nil {
g.Opt.ErrorFunc(g, req, err)
} else {
log.Println(err)
}
return
}