RECOGNIZER
A recognizer failed during registration or scanning.
What it means
RecognizerError (code: RECOGNIZER). Thrown when a pattern fails validation at definePatternRecognizer registration, or when describing why a recognizer was skipped at runtime (warnings only - check() does not throw for scan-time failures).
Message shape
<reason> → https://tailrace.dev/docs/reference/errors/RECOGNIZERRegistration examples: pattern 0: nested quantifiers on groups are not allowed, entity "email" is reserved for built-in recognizers.
Common causes
- Pattern source violates static safety rules (backreference, nested quantifiers, overlong source).
- Entity name reuses a built-in class or invalid shape.
- Custom
scan()threw during detection (engine skips that recognizer and logs a warning).
Runtime behavior (v0.2+)
- Registration: fail fast - fix the pattern or entity name before calling
createTailrace. - Scan budget exceeded: fail open - remaining matches from that recognizer are skipped; one console warning; other recognizers continue.
- Custom
scan()throw: fail open - that recognizer is skipped; others continue.
Built-in Tier 0 recognizers are trusted code paths. Optional Tier 1 should degrade with a warning when the model is missing, not crash the host.
Fixes
- Use
definePatternRecognizerfor regex entities instead of hand-rolled loops when possible. - Declare policy for custom entity classes (
entities.employee_id, etc.). - Fix or remove throwing custom recognizers.
Safe to catch?
Catch at registration time when building recognizer lists from user/config input. Do not rely on check() throwing RecognizerError for scan-time issues - those are logged and skipped.
If a block policy depends on a broken custom recognizer, detection may miss the entity (documented gap). Built-in secret blocking is unaffected.