check parseURI error for elasticsearch init (#752)

return error if it occurred when we parse elasticsearch url
This commit is contained in:
Romanenko Alexey
2020-05-26 18:04:38 +03:00
committed by GitHub
parent 11bd20f251
commit 1a5ac70c24
+2 -2
View File
@@ -5,12 +5,11 @@ import (
"log"
"net/url"
"strings"
//"regexp"
"time"
"github.com/buger/goreplay/proto"
"github.com/mattbaird/elastigo/lib"
elastigo "github.com/mattbaird/elastigo/lib"
)
type ESUriErorr struct{}
@@ -67,6 +66,7 @@ func parseURI(URI string) (err error, index string) {
if parseErr != nil {
err = new(ESUriErorr)
return
}
// check URL validity by extracting host and undex values.