Skip to content

Commit

Permalink
Fix error message in request.go (#5768)
Browse files Browse the repository at this point in the history
I have that error displayed which sounds grammatically wrong:

Could not execute request for http://x.x.x.x/: could get html element: error occurred executing action: [:RUNTIME] could not navigate to url http://x.x.x.x/login <- navigation failed: net::ERR_ADDRESS_UNREACHABLE
  • Loading branch information
dmaciejak authored Oct 25, 2024
1 parent 40a08a4 commit 2039b5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/protocols/headless/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

var _ protocols.Request = &Request{}

const errCouldGetHtmlElement = "could get html element"
const errCouldNotGetHtmlElement = "could not get html element"

// Type returns the type of the protocol request
func (request *Request) Type() templateTypes.ProtocolType {
Expand Down Expand Up @@ -117,7 +117,7 @@ func (request *Request) executeRequestWithPayloads(input *contextargs.Context, p
if err != nil {
request.options.Output.Request(request.options.TemplatePath, input.MetaInput.Input, request.Type().String(), err)
request.options.Progress.IncrementFailedRequestsBy(1)
return errors.Wrap(err, errCouldGetHtmlElement)
return errors.Wrap(err, errCouldNotGetHtmlElement)
}
defer instance.Close()

Expand All @@ -130,7 +130,7 @@ func (request *Request) executeRequestWithPayloads(input *contextargs.Context, p
if _, err := url.Parse(input.MetaInput.Input); err != nil {
request.options.Output.Request(request.options.TemplatePath, input.MetaInput.Input, request.Type().String(), err)
request.options.Progress.IncrementFailedRequestsBy(1)
return errors.Wrap(err, errCouldGetHtmlElement)
return errors.Wrap(err, errCouldNotGetHtmlElement)
}
options := &engine.Options{
Timeout: time.Duration(request.options.Options.PageTimeout) * time.Second,
Expand All @@ -146,7 +146,7 @@ func (request *Request) executeRequestWithPayloads(input *contextargs.Context, p
if err != nil {
request.options.Output.Request(request.options.TemplatePath, input.MetaInput.Input, request.Type().String(), err)
request.options.Progress.IncrementFailedRequestsBy(1)
return errors.Wrap(err, errCouldGetHtmlElement)
return errors.Wrap(err, errCouldNotGetHtmlElement)
}
defer page.Close()

Expand Down

0 comments on commit 2039b5c

Please sign in to comment.