Commit
Harden CLAP-search not-ready error classification against instanceof
Commit details
Commit notes
The full backend test suite intermittently failed "clap-search public failures > maps not-ready states to safe 200 responses": getSafeClapSearchFailure returned 503 instead of 200 because its instanceof ClapSearchNotReadyError check can see a different class instance than the error when this module is loaded more than once (bun's cross-file mock.module pollution in the full suite). Add a duck-typed fallback (name + readiness shape) so genuine not-ready errors are always mapped to a safe 200, regardless of module identity.
Co-Authored-By: Claude Opus 4.8 <[email redacted]>
- Files changed
- 1
- Lines added
- +14
- Lines removed
- −1