projectdiscovery/subfinder · error

(code )

Error message

%s (code %d)

What it means

API-level error from the DigitalYama passive source: the HTTP response carried a non-200 status and a JSON body with a detail array; the first detail item's message is interpolated as the error text with the status code. It signals the server rejected the request (bad key, bad domain, quota) rather than a transport failure.

Solutions

  1. Read the API message in the error text — it usually identifies an invalid API key or malformed domain
  2. Verify the DigitalYama API key supplied via keys configuration
  3. If the status suggests rate limiting, wait and retry the domain later
  4. Skip this source for the run and rely on the other passive sources for coverage
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/subscraping/sources/digitalyama/digitalyama.go:83 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of projectdiscovery/subfinder@7a0b91f0fa (2026-09-06). Data as JSON: /api/errors/859250b59c874502. Report an issue: GitHub.

Appendix: source

Thrown at pkg/subscraping/sources/digitalyama/digitalyama.go:83

		}()

		if resp.StatusCode != 200 {
			var errResponse struct {
				Detail []struct {
					Loc  []string `json:"loc"`
					Msg  string   `json:"msg"`
					Type string   `json:"type"`
				} `json:"detail"`
			}
			err = jsoniter.NewDecoder(resp.Body).Decode(&errResponse)
			if err != nil {
				results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("unexpected status code %d", resp.StatusCode)}
				s.errors++
				return
			}
			if len(errResponse.Detail) > 0 {
				errMsg := errResponse.Detail[0].Msg
				results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("%s (code %d)", errMsg, resp.StatusCode)}
			} else {
				results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("unexpected status code %d", resp.StatusCode)}
			}
			s.errors++
			return
		}

		var response digitalYamaResponse
		err = jsoniter.NewDecoder(resp.Body).Decode(&response)
		if err != nil {
			results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
			s.errors++
			return
		}

		for _, subdomain := range response.Subdomains {
			select {
			case <-ctx.Done():

View on GitHub (pinned to 7a0b91f0fa)