Commit 967eda6
Replace FAISS_ASSERT with FAISS_THROW_FMT for unsupported SVSStorageKind (#5182)
Summary:
Pull Request resolved: #5182
The `default` branch of `to_svs_storage_kind()` previously used `FAISS_ASSERT(false && "not supported SVS storage kind")`, which calls `abort()` and tears down the process with no recoverable error. This makes invalid storage kinds — whether from a corrupted index file, a forward-compat mismatch, or a SWIG caller passing a bogus enum value — fatal in a way that cannot be caught by the Python or C++ exception machinery.
Replace with `FAISS_THROW_FMT(...)` so the unsupported-kind path raises a `FaissException` that callers can catch, and include the offending integer value in the message to make debugging easier.
Reviewed By: mnorris11
Differential Revision: D103914271
fbshipit-source-id: 54d8673d5e533fbdee08262e811de54344b2ca601 parent 0320279 commit 967eda6
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
0 commit comments