You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use tl::unexpected in Index default implementations
Replace throw std::runtime_error with tl::unexpected(Error) in Index
virtual method default implementations that return tl::expected<T, Error>.
This ensures error handling is consistent with the API contract.
- Use ErrorType::UNSUPPORTED_INDEX_OPERATION for all unsupported operations
- Standardize error messages to "Index does not support <operation>"
- Change CheckFeature default to return false instead of throwing
- Update tests to use REQUIRE_FALSE(has_value()) for expected-returning methods
- Remove is_old_index parameter from TestBatchCalcDistanceById
Methods returning non-expected types (GetStats, GetMemoryUsageDetail, etc.)
retain throw behavior as they cannot use tl::unexpected.
Closes#2140
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
0 commit comments