pbakaus/impeccable · info

Aborted.

Error message

Aborted.

What it means

When a directory target contains more than 50 files and stdin is an interactive TTY (non-JSON, non-quiet mode), scan_targets warns that the scan may take a while and calls confirm("Continue?"). If the user answers anything interpreted as "no", it prints "Aborted." to stderr and returns Err(Exit(0)) — the scan is cancelled by explicit user choice, with exit code 0, not an error condition.

Source

Thrown at crates/detect/src/cli.rs:756

                walk_failures.push((dir.to_string(), node_scan_error(dir, err)));
            })
            .into_iter()
            .filter(|f| !should_ignore_detection_file(f, &cwd, &ctx.config))
            .collect();
            for (dir, message) in walk_failures {
                ctx.report_local_scan_failure(&dir, &message);
            }
            let html_count = files.iter().filter(|f| is_html_path(f)).count();
            if files.len() > 50 && ctx.stdin_tty && !ctx.json_mode && !ctx.quiet_mode {
                ctx.io.err(&format!(
                    "\nFound {} files ({} HTML) in {}.\nScanning may take a while{}.\nTarget a specific subdirectory to narrow scope.\n",
                    files.len(),
                    html_count,
                    target,
                    if html_count > 10 { " (static HTML/CSS processes each HTML file individually)" } else { "" }
                ));
                if !confirm(ctx.io, "Continue?") {
                    ctx.io.err("Aborted.\n");
                    return Err(Exit(0));
                }
            }
            let mut unreadable_files: Vec<String> = Vec::new();
            let mut read_failures: Vec<(String, String)> = Vec::new();
            let graph = build_import_graph_reporting(&files, &mut |file, err| {
                unreadable_files.push(file.to_string());
                read_failures.push((file.to_string(), node_scan_error(file, err)));
            });
            for (file, message) in read_failures {
                ctx.report_local_scan_failure(&file, &message);
            }
            let mut imported_by_map: Vec<(String, Vec<String>)> = Vec::new();
            for (importer, imports) in &graph {
                for imported in imports {
                    if let Some(slot) = imported_by_map.iter_mut().find(|(k, _)| k == imported) {
                        if !slot.1.contains(importer) {
                            slot.1.push(importer.clone());

View on GitHub (pinned to 2bc2879276)

Solutions

  1. Re-run and answer 'Y' (or just accept the default) at the Continue? prompt
  2. Narrow the target to a specific subdirectory so the file count stays under 50 and the prompt is skipped
  3. Run with --quiet or --json mode to bypass the interactive confirmation entirely
  4. Pipe/redirect stdin (non-TTY) in scripts so the prompt path is not taken

Example fix

// before
$ impeccable detect .
Found 512 files (30 HTML) in .
Continue? [Y/n] n
Aborted.

// after
$ impeccable detect ./src/components  # narrower scope, no prompt
Defensive patterns

Strategy: fallback

Validate before calling

// Count files first to anticipate the prompt
const count = require('child_process')
  .execSync('find <dir> -type f | wc -l').toString().trim();
if (Number(count) > 50) console.log('scan will prompt for confirmation');

Try / catch

// Treat exit code 0 with 'Aborted.' on stderr as user cancellation
const res = spawnSync('impeccable', ['detect', dir]);
if (res.status === 0 && /Aborted\./.test(res.stderr.toString())) {
  // scan was cancelled at the confirm prompt — not a scan failure
}

Prevention

When it happens

Trigger: Running `impeccable detect <dir>` on a directory whose file list (after ignore filtering) exceeds 50 entries, with a TTY on stdin, and typing 'n' (or Enter-then-no semantics) at the "Continue? [Y/n]" prompt.

Common situations: Accidentally pointing detect at a huge directory like node_modules-adjacent output or a whole repo root; an interactive CI/PTY wrapper auto-answering the prompt; pressing Enter expecting the default Y but the terminal session sent something else.

Related errors


AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08). Data as JSON: /api/errors/9bff52c9e5f649c8. Report an issue: GitHub.