From 20c00a1f21fe910deead8f76cf5084ae1e67ee47 Mon Sep 17 00:00:00 2001 From: Vishal Kumar Singh Date: Sat, 16 May 2026 17:00:43 +0530 Subject: [PATCH] fix(runner): return error when -fpt filter fails to initialize When users specify -fpt (filter-page-type) flag, the dit classifier must be successfully initialized. Previously, if the dit model was missing, httpx would only log a warning and silently fail to apply the filter, causing unexpected behavior where error pages would not be filtered as expected. This change returns a descriptive error when the classifier cannot be initialized for -fpt usage, guiding users to run 'dit data download' to install the required model. Fixes #2495 Co-authored-by: Cursor --- runner/runner.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runner/runner.go b/runner/runner.go index af9db566..d775125b 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -434,6 +434,9 @@ func New(options *Options) (*Runner, error) { if options.JSONOutput || options.CSVOutput || len(options.OutputFilterPageType) > 0 { ditClassifier, err := dit.New() if err != nil { + if len(options.OutputFilterPageType) > 0 { + return nil, fmt.Errorf("could not initialize page classifier for -fpt filter: %w (run 'dit data download' to install the model)", err) + } gologger.Warning().Msgf("Could not initialize page classifier: %s", err) } runner.ditClassifier = ditClassifier