Skip to content

Commit

Permalink
Fix error wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 25, 2024
1 parent 2fae4ca commit 1523d72
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions messagix/js_module_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ func (m *ModuleParser) fetchPageData(page string) ([]byte, error) { // just log.
headers.Set("sec-fetch-user", "?1")
headers.Set("upgrade-insecure-requests", "1")
_, responseBody, err := m.client.MakeRequest(page, "GET", headers, nil, types.NONE)
if err != nil {
return nil, fmt.Errorf("messagix-moduleparser: failed to fetch page data for page %s (%v)", page, err)
}

return responseBody, nil
return responseBody, err
}

func (m *ModuleParser) Load(page string) error {
Expand All @@ -83,7 +79,7 @@ func (m *ModuleParser) Load(page string) error {

doc, err := html.Parse(bytes.NewReader(htmlData))
if err != nil {
return fmt.Errorf("messagix-moduleparser: failed to parse doc string (%v)", err)
return fmt.Errorf("messagix-moduleparser: failed to parse doc string (%w)", err)
}

scriptTags := m.findScriptTags(doc)
Expand Down

0 comments on commit 1523d72

Please sign in to comment.