Billionmail/BillionMail · error

http get error: %s

Error message

http get error: %s

What it means

Status guard in HttpGetSrc: the HTTP request completed, but resp.StatusCode is outside 200-299 (the condition flags anything below OK or >= 300), so the body is not trusted and an error carrying resp.Status (e.g. '404 Not Found') is set before the body is read. Note the logic also misfires on 3xx, which are redirects rather than failures.

Source

Thrown at core/internal/service/public/common.go:314

	context, err := io.ReadAll(resp.Body)
	if err != nil {
		return "", err
	}
	return string(context), nil
}

// Native HTTP GET request
func HttpGetSrc(url string, timeout int) (respBody string, err error) {
	client := GetHttpClient(timeout)
	resp, err := client.Get(url)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	// Check status code
	if resp.StatusCode < http.StatusOK && resp.StatusCode >= http.StatusMultipleChoices {
		err = fmt.Errorf("http get error: %s", resp.Status)
	}

	var bs []byte
	bs, err = io.ReadAll(resp.Body)
	if err != nil {
		return
	}

	respBody = string(bs)

	return
}

// Send GET request and return JSON data
func HttpGetJson(url string, timeout int, pointer interface{}) (err error) {
	var respBody string

	if respBody, err = HttpGetSrc(url, timeout); err != nil {

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Log or inspect the embedded HTTP status to identify 4xx/5xx causes at the target URL
  2. Retry with backoff for transient 5xx responses
  3. Fix the range check to only treat >=400 as error if 3xx handling is undesired
  4. Check redirect handling/configured timeout on GetHttpClient when odd statuses appear
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at core/internal/service/public/common.go:314 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/169a45405b8d3957. Report an issue: GitHub.