paulirwin opened a new issue, #1023: URL: https://github.com/apache/lucenenet/issues/1023
> I discovered that inside of several of the methods of `BitVector`, we are throwing `IndexOutOfRangeException`. `IndexOutOfRangeException` is a special exception type in .NET that should only be thrown from the setter of an indexer. In virtually all other cases, these should be converted to `ArgumentOutOfRangeException`. Looks like there are a handful of other types that are throwing it, as well. We should ... convert these to `ArgumentOutOfRangeException` and double-check that there will be no adverse effects from making the change. These were originally intentionally normalized to `IndexOutOfRangeException` to make the error handling simpler, but since then we have fixed the error handling to catch either `IndexOutOfRangeException` or `ArgumentOutOfRangeException` and treat them the same using the [`IsIndexOutOfBoundsException()` extension method](https://github.com/apache/lucenenet/blob/92029e8987076ff7264c4d5c8ce28ea77af9bd26/src/Lucene.Net/Support/ExceptionHandling/Exception Extensions.cs#L260-L266) (although, it may not be used everywhere it is needed to make the change). _Originally posted by @NightOwl888 in https://github.com/apache/lucenenet/pull/1018#discussion_r1842253910_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org