epi052/feroxbuster · error
Extractor requires a URL or a FeroxResponse be specified as…
Error message
Extractor requires a URL or a FeroxResponse be specified as well as a Handles object
What it means
ExtractorBuilder::build requires either a URL (with_url) or a FeroxResponse (with_response) plus a Handles object; otherwise no extractor can be constructed since there is nothing to scrape links from and no configuration context.
Solutions
- Chain .with_url(&url) (or .with_response(&response)) before build()
- Chain .with_handles(handles.clone()) before build()
- Verify the builder call chain compiles to include both a source (url/response) and handles
Example fix
// before
let extractor = ExtractorBuilder::default().build()?;
// after
let extractor = ExtractorBuilder::default()
.with_url("https://example.com")
.with_handles(handles.clone())
.build()?; Defensive patterns
Strategy: validation
Validate before calling
fn builder_ready(url: &str, response: Option<&FeroxResponse>, handles: Option<Handles>) -> bool {
(!url.is_empty() || response.is_some()) && handles.is_some()
}
if !builder_ready(&url, response.as_ref(), handles) {
return Err("extractor needs url or response, plus handles".into());
} Type guard
fn has_handles(h: &Option<Handles>) -> bool { h.is_some() } Try / catch
let extractor = builder.build().map_err(|e| {
eprintln!("builder incomplete: {e}; did you forget with_url/with_response or with_handles?");
e
})?; Prevention
- Chain with_url or with_response and with_handles in the same builder expression
- Prefer builder methods over ExtractorBuilder::default() to avoid incomplete states
- Add a unit test that builds an extractor the way production code does
When it happens
Trigger: Calling build() without having chained with_url()/with_response(), or without with_handles() — e.g. a builder created with ExtractorBuilder::default() and immediately built.
Common situations: Refactors dropping a builder method call; copy-pasted builder code missing with_url when switching from response-based to URL-based extraction; forgetting with_handles after changing constructor signatures across versions.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13).
Data as JSON: /api/errors/a6bd590ed38e89ea.
Report an issue: GitHub.
Appendix: source
Thrown at src/extractor/builder.rs:132
/// builder call to set `target`
pub fn target(&mut self, target: ExtractionTarget) -> &mut Self {
self.target = target;
self
}
/// builder call to set `response`
pub fn response(&mut self, response: &'a FeroxResponse) -> &mut Self {
self.response = Some(response);
self
}
/// finalize configuration of `ExtractorBuilder` and return an `Extractor`
///
/// requires either `with_url` or `with_response` to have been used in the build process
pub fn build(&self) -> Result<Extractor<'a>> {
if (self.url.is_empty() && self.response.is_none()) || self.handles.is_none() {
bail!("Extractor requires a URL or a FeroxResponse be specified as well as a Handles object")
}
Ok(Extractor {
links_regex: Regex::new(LINKFINDER_REGEX).unwrap(),
robots_regex: Regex::new(ROBOTS_TXT_REGEX).unwrap(),
url_regex: Regex::new(URL_CHARS_REGEX).unwrap(),
response: self.response,
url: self.url.to_owned(),
handles: self.handles.as_ref().unwrap().clone(),
target: self.target,
})
}
}
View on GitHub (pinned to 1f595dab5c)