From ecb2cc0c0685ae376ea5bda43a88e1a14bd9fcdf Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Thu, 8 Dec 2022 00:28:28 -0800 Subject: [PATCH] add todos for error handling --- wrp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wrp.go b/wrp.go index 1b1cc67..dd1647f 100644 --- a/wrp.go +++ b/wrp.go @@ -219,6 +219,8 @@ func (rq *wrpReq) navigate() { // Handle context errors func ctxErr(err error, w io.Writer) { + // TODO: callers should have retry logic, perhaps create another function + // that takes ...chromedp.Action and retries with give up if err == nil { return } @@ -381,7 +383,7 @@ func pageServer(w http.ResponseWriter, r *http.Request) { rq.printHTML(printParams{bgColor: "#FFFFFF"}) return } - rq.navigate() + rq.navigate() // TODO: if error from navigate do not capture rq.capture() } @@ -410,7 +412,7 @@ func mapServer(w http.ResponseWriter, r *http.Request) { rq.printHTML(printParams{bgColor: "#FFFFFF"}) return } - rq.navigate() + rq.navigate() // TODO: if error from navigate do not capture rq.capture() }