Skip to content

Commit aaad1df

Browse files
Fixed status code check error reporting.
1 parent d6ccdad commit aaad1df

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • chapter2/sample/matchers

chapter2/sample/matchers/rss.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package matchers
33
import (
44
"encoding/xml"
55
"errors"
6+
"fmt"
67
"log"
78
"net/http"
89
"regexp"
@@ -125,7 +126,7 @@ func (m *rssMatcher) retrieve(feed *search.Feed) (*document, error) {
125126
// Check the status code for a 200 so we know we have received a
126127
// proper response.
127128
if resp.StatusCode != 200 {
128-
return nil, err
129+
return nil, fmt.Errorf("HTTP Response Error %d\n", resp.StatusCode)
129130
}
130131

131132
// Decode the rss feed document into our struct type.

0 commit comments

Comments
 (0)