Dispatching on only Int is too restrictive. Generic code is normally preferable, so it’s better to define special behavior only for the exceptional cases you want to rule out (Bool input, in this case).
But if you don’t want to write the extra methods to manage those exceptions, at least I recommend you to allow any other Integer that is not Bool. Bool happens to be the only subtype of Integer which is not either Signed or Unsigned, so you could write:
While restricting the input is an option to catch the error at that point, it seems that the bug was probably before the call to your function, somewhere where a Bool was generated where an integer was expected to be generated. Perhaps the proper place to add an error message or deal with the Bool was at that point, if for some reason that turns out to be possible and the program is expected to stop if that occurs.
(otherwise, although you can prevent that error from propagating in your own functions, it will propagate in every other functions of other packages or Base that accept Bools as integers, which are probably most of them)
This should accept all the same types of indices that other Julia arrays do, staying up-to-date with whatever to_indices does. Specifically, Bools will be disallowed, while other integers are accepted.
(Please be aware, I’ve never had reason to use to_indices before, so double check that it works as expected.)