Private
Public Access
0
0
Files
manual_slop/src
ed f322052cc6 refactor(rag_engine): narrow 'except Exception' in _get_sentence_transformers (Phase 13 site 1)
Site 1 (BC at L33) was:
    except Exception as e:
        sys.stderr.write(f'FAILED to import sentence_transformers: {e}')
        sys.stderr.flush()
        raise e

Per TIER1_REVIEW: catch + log + re-raise is Pattern 2 of the styleguide.
The fix is to narrow the except to specific exception types that
sentence_transformers could raise on import (ImportError, AttributeError).

Refactored to:
    except (ImportError, AttributeError) as e:
        sys.stderr.write(f'FAILED to import sentence_transformers: {e}')
        sys.stderr.flush()
        raise

The bare 'raise' re-raises the current exception being handled,
preserving the original type and traceback. (Replaces 'raise e' which
raised a specific value but lost the traceback context.)

Audit: rag_engine BC 5 -> 4. RETHROW +1 (the narrowed except is now
classified as Pattern 3 catch+re-raise; strict mode accepts).
2026-06-20 16:06:48 -04:00
..